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
Contributor
Posts: 48
Registered: ‎06-30-2010
My Device: 9000
My Carrier: Non

How to upgrade Blackberry Application from old version to new??

Hi All, I'm developing a background application. In that we maintaining many persistent storage. The Question is, How to get the persistent values from the old version to new version while upgrading the app.
Developer
Posts: 16,992
Registered: ‎07-29-2008
My Device: Z10 LE, Z30, Passport
My Carrier: O2 Germany

Re: How to upgrade Blackberry Application from old version to new??

if you store the values in a generic object without using custom persistable classes the contents should be retained.

if this does not work you could implement SyncItem to allow the user to backup the settings.
----------------------------------------------------------
feel free to press the like button on the right side to thank the user that helped you.
please mark posts as solved if you found a solution.
@SimonHain on twitter
Contributor
Posts: 48
Registered: ‎06-30-2010
My Device: 9000
My Carrier: Non

Re: How to upgrade Blackberry Application from old version to new??

Please can u provide me the sample code ..

Developer
Posts: 19,636
Registered: ‎07-14-2008
My Device: Not Specified

Re: How to upgrade Blackberry Application from old version to new??

Contributor
Posts: 48
Registered: ‎06-30-2010
My Device: 9000
My Carrier: Non

Re: How to upgrade Blackberry Application from old version to new??

Actually i know about persistent storage. But my problem is , if i upgrade the Application all persistent data getting loss in new version app . I need that old persistent data values in new version app also.

Developer
Posts: 19,636
Registered: ‎07-14-2008
My Device: Not Specified

Re: How to upgrade Blackberry Application from old version to new??

[ Edited ]

One of the things you should know about persistent store is that if the classes you put in PersistentStore change with the new Application, then you have rendered the data in the old class unreadable, so your only option is to delete the app (deleting the old class data) and install the new app.   

 

So use generic classes or make compatible changes and you will be able to upgrade your app. 

 

For example, if you persist a HashTable, and you add String values to it, then this doesn't change regardless of the number of String values you add.  But if you store a custom class and you add another variable to that class, then it has changed and will be incompatible.

 

Does that help?

Contributor
Posts: 48
Registered: ‎06-30-2010
My Device: 9000
My Carrier: Non

Re: How to upgrade Blackberry Application from old version to new??

Thanks a lot Smiley Happy ... I got it....

Developer
Posts: 19,636
Registered: ‎07-14-2008
My Device: Not Specified

Re: How to upgrade Blackberry Application from old version to new??

Solved?  if so can you mark it as Solved?  instructions in the Help lenk near the top of the screen.