Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Java Development

Reply
Regular Contributor
guydor
Posts: 65
Registered: ‎05-15-2011
My Device: 9700
My Carrier: Att
Accepted Solution

Detect app deletion or Remove files from SD Card after app deletion

Hi,

 

I've developed an app that or 1st launch copies sqlite database to the device memory card.

 

I also want to delete this database file in case the user uninstalls the app.

 

Is it possible ?

 

Thanks!

Please use plain text.
BlackBerry Development Advisor (Retired)
rmasroor
Posts: 172
Registered: ‎06-07-2010
My Device: BlackBerry 8520
My Carrier: Rogers

Re: Detect app deletion or Remove files from SD Card after app deletion

Hello guydor,

 

How are you doing? I hope all is well.

 

The only way for an app to do a cleanup is to actually have a second cleanup installed running in the background(COD file that is not part of the main CodeModuleGroup), which has a CodeModuleListener. If it detects the main app is deleted, it performs cleanup/removal of the db, and then deletes itself via CodeModuleManager.deleteModuleEx.

 

Let me know if you have any further questions.

Raihan Masroor
BlackBerry Development Advisor
Please use plain text.
Contributor
sonanaren
Posts: 41
Registered: ‎05-26-2011
My Device: Developer
My Carrier: Developer

Re: Detect app deletion or Remove files from SD Card after app deletion

Me also having this requirement and i couldnt get you, please bare with me if its silly

 

Will second cleanup comes built-in with the BlackBerry Device or we need to create a background app (COD) to perform the same.

 

Let me know if you need more information

Please use plain text.
BlackBerry Development Advisor (Retired)
rmasroor
Posts: 172
Registered: ‎06-07-2010
My Device: BlackBerry 8520
My Carrier: Rogers

Re: Detect app deletion or Remove files from SD Card after app deletion

Hello Sona,

 

How are you doing? I hope all is well.

 

In regards to your questions, I actually meant to create a seperate background application that had a CodeModuleListener listening to the modules via CodeModuleListener.modulesDeleted(modules). As soon as the modules are deleted, you can delete the associated app's dbs and then delete the background application using the CodeModuleManager.deleteModuleEx method. 

 

Let me know if you have any questions and I will be more than happy to help you out.

Raihan Masroor
BlackBerry Development Advisor
Please use plain text.
Contributor
sonanaren
Posts: 41
Registered: ‎05-26-2011
My Device: Developer
My Carrier: Developer

Re: Detect app deletion or Remove files from SD Card after app deletion

rmasroor,

 

Thanks for your reply, will work on it and get back to you if i have any issuess

 

Please use plain text.