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. New to the forum? Please visit the ‘Getting Started’ link below.
inside custom component

Java Development

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

Re: Persistent Store Across Application Upgrades

[ Edited ]

2 almeida: I have had issues (exceptions were thrown at runtime) when I installed updated applications with altered persistable classes over the old persisted data.

 

Nothing was rewritten automatically.

 

Just my experience.


Message Edited by tbilisoft on 17-07-2009 03:19 PM
Please use plain text.
Developer
Ted_Hopp
Posts: 1,304
Registered: ‎01-21-2009

Re: Persistent Store Across Application Upgrades

You can also extend Hashtable and use it to store name/value pairs. No need to generate or parse XML, and no fields to cause runtime exceptions. Don't use Hashtable directly, since then (as others pointed out) the only way to remove the data is to wipe the device.



Solved? click "Accept as solution". Helpful? give kudos by clicking on the star.
Please use plain text.
Regular Contributor
francesco_fd
Posts: 68
Registered: ‎09-02-2011

Re: Persistent Store Across Application Upgrades

Hello Ted,

you wrote

" Don't use Hashtable directly, since then (as others pointed out) the only way to remove the data is to wipe the device. "

but, using

PersistentStore.destroyPersistentObject(PERSISTENT_STORE_KEY);

you are able to destroy the persistent object, aren't you?

 

 

Please use plain text.
Developer
peter_strange
Posts: 17,630
Registered: ‎07-14-2008

Re: Persistent Store Across Application Upgrades

Not sure Ted is around anymore but I can confirm the approach you have suggested will work. 

Please use plain text.
Regular Contributor
sporadicsoftware
Posts: 70
Registered: ‎09-30-2011
My Carrier: Sprint

Re: Persistent Store Across Application Upgrades

What about when using Eclipse during development? Everytime I use "Load Project(s) on Device" the app seems to be removed first and then installed again. Is there a way to tell Eclipse to perform an upgrade instead? The first part of my app requires that you use OAuth to retrieve a toke. I can save that token but not between builds. Makes development a chore. Is the best answer to hard code the token information during development?

 

Thanks

Nicholas

Please use plain text.