01-11-2009 03:15 PM
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?
Solved! Go to Solution.
01-11-2009 03:58 PM
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.
01-11-2009 03:59 PM
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.
01-15-2009 08:57 AM
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.
02-24-2010 02:30 PM
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. 18.104.22.168 to 22.214.171.124) 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?