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
New Contributor
Posts: 8
Registered: ‎08-09-2011
My Device: montana
My Carrier: verizon
Accepted Solution

Need to distinguish between app deletion and app upgrade

Hi, I am working on a app, where I save files on the SD Card and delete them when I delete the app. 

 

I used a background app implementing CodeModuleListener (modulesDeletionPending) , it works in case of deletion .

 

But the problem is - I want to retain those files when user upgrades the app, in that case also we get a callback into "modulesDeletionPending" , it would be great if someone can guide me as to what should I do differently during an upgrade.

 

Regards,

Sarnab

Highlighted
Retired
Posts: 1,561
Registered: ‎04-12-2010
My Device: BlackBerry Z10
My Carrier: Bell

Re: Need to distinguish between app deletion and app upgrade

Hello sarnab2,

 

I do not believe there is an easy way to monitor for this. A secondary application could check on start-up whether your primary application's COD files exist and, if not, delete the data on the SD Card and then delete itself:

http://supportforums.blackberry.com/t5/Java-Development/Can-an-application-uninstall-itself/m-p/3034...

 

Erik Oros

BlackBerry Development Advisor


Erik Oros | @WaterlooErik | eoros@blackberry.com | Developer Issue Tracker

If a reply has answered your question, please click Accept as Solution to help other visitors in the future.
New Contributor
Posts: 8
Registered: ‎08-09-2011
My Device: montana
My Carrier: verizon

Re: Need to distinguish between app deletion and app upgrade

Thanks Eric,

 

Yes I already did that now, and it is successful, Thanks a lot for your reply.

 

Regards,

Sarnab