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
Developer
Posts: 5,339
Registered: ‎09-20-2008
My Device: ***
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
Developer
Posts: 1,305
Registered: ‎01-21-2009
My Device: Not Specified

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.
Regular Contributor
Posts: 68
Registered: ‎09-02-2011
My Device: Torch 9800

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?

 

 

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

Re: Persistent Store Across Application Upgrades

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

Highlighted
Developer
Posts: 72
Registered: ‎09-30-2011
My Device: Bold 9930 & PlayBook
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