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

New Developer
Posts: 9
Registered: ‎10-15-2008
My Device: Not Specified

about self-update application solution..


I want to upgrade my application When installed application, on the device, is older than newly version, on the web server.

So... I tried to self-update application on Blackberry using HTTPConnection.
The application download a.jad file via HTTP. Then, compare a version number with current installed one.

Ok, It works well. I can delete current application using CodeModuleManager.deleteModuleEx(), 
and also install new application using CodeModuleManager.createNewModule/saveNewModule().

And now, I have a question.

Is it only way to (self)upgrade solution on code level?

Because, After delete - create/save module, a ModuleHandleId will be changed. then, the persistence storage data (of old one, which deleted just now) is still accessable on newModule? If not, How can I access it?
Posts: 5,339
Registered: ‎09-20-2008
My Device: ***
My Carrier: ***

Re: about self-update application solution..

If you stored class instances of your old application this data is going to be removed when you uninstall your application. If you stored other class instances, for example java.util.Vector instance(s) this data will remain in persistent store.


That's hard to say will the RIM OS preserve data when you delete cod-modules programatically. Most likely the aforecited rule should work in this case too.


It needs to be checked. Just create a simple app and write to data the persistent store. After that renew it programatically and try to access data with the same persistence key.

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

Re: about self-update application solution..

Please see the following link.


How To - Handle stored data when removing an application
Article Number: DB-00424



However, note that an application can not update itself using CodeModuleManager.  You would need to create a second application that does the updating.  Alternatively, you could invoke the browser and open your JAD file to update the application.

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