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
Highlighted
New Developer
Posts: 5
Registered: ‎11-17-2008
My Device: Not Specified
Accepted Solution

application update/upgrade

Hi,

 

Which is the best way to upgrade an application without loosing the data in the Persistent Store? Probably it should be as easy as downloading the new app and replace the old one. But based some tests that I've made, in some situations the data in the Persistent Store is lost after the application is updated and the device is restarted. (this happens for example when using the 4.1  7290 simulator)  So, how should the application update process work in theory (when is the data deleted and when not), and how does it work on the actual device?

 

Thank you!

 

 

 

Developer
Posts: 5,339
Registered: ‎09-20-2008
My Device: ***
My Carrier: ***

Re: application update/upgrade

If you pass your own objects like com.yourcompany.MyClass to the persistent store they will be removed when you uninstall your application.

 

If you use common classes like java.util.Vector they will remain in persistent memory  even if you uninstall your app.

 

I do not tell you to use only common classes, it is a bad approach. It is better to save your own class instances.

 

To preserve your data  - do not uninstall old application, just install the new app over the old application.

Developer
Posts: 5,339
Registered: ‎09-20-2008
My Device: ***
My Carrier: ***

Re: application update/upgrade

Also make sure that your new app uses the same long keys as the old application uses.

 

And classes which instances you want to load are exactly the same as in old application, including full qualified names.

Developer
Posts: 5,339
Registered: ‎09-20-2008
My Device: ***
My Carrier: ***

Re: application update/upgrade

Also you can backup/restore your data via Blackberry Desktop Manager.

 

Check SyncDemo application in JDE samples.

BlackBerry Development Advisor
Posts: 15,508
Registered: ‎07-09-2008
My Device: BlackBerry PRIV
My Carrier: Bell

Re: application update/upgrade

As long as the persistent classes that hold your data have not been changed, the data should remain after it has been upgraded.  If you modify these classes the data will be lost during an upgrade.

 

If you need to modify your persistent classes you could create a new class.  The updated application could read in the old classes, convert to the new ones and then save them to persistent store.

Mark Sohm
BlackBerry Development Advisor

Please refrain from posting new questions in solved threads.
Problem solved? Click the Accept As Solution button.
Found a bug? Report it using Issue Tracker
New Contributor
Posts: 3
Registered: ‎02-24-2010
My Device: BlackBerry 9700
My Carrier: T-Mobile

Re: application update/upgrade

If we do not change the version number that appears in the jad file, our RMS data persists.  If, however, we increment the version number, our application data is lost when we update/upgrade our app (even if no other changes were made).  We've tested this numerous times changing "only" the version # that appears in the jad (e.g. 1.0.9.1 to 1.0.9.2) and that single change is the difference between the data persisting and the data being lost.  Does anyone have any thoughts on why this might be?