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: 37
Registered: ‎07-17-2008
My Device: Not Specified
Accepted Solution

Automatically Update Application

Hi,

 

We want to automatically update one of our applications. It will be checking the server (basic HTTP request to check the current latest version) and if a newer version of the application is available it will download and install the new version after the user agrees. Does anyone have any sample code for the upgrade part? Thank you.

Developer
Posts: 16,992
Registered: ‎07-29-2008
My Device: Z10 LE, Z30, Passport
My Carrier: O2 Germany

Re: Automatically Update Application

i define the address of the jad-file in the application. a seperate thread downloads the beginning of the jad-file, gets the substring beginning with MIDlet-Version: and compares it to the local version. if it is different / bigger the user is prompted to download the newer version (invoke the browser with the jad).
----------------------------------------------------------
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
Developer
Posts: 37
Registered: ‎07-17-2008
My Device: Not Specified

Re: Automatically Update Application

Thanks, Simon.

 

Do you know of a way that I can download and update automatically from the application? Or maybe from an external application (like Google Mobile Updater)?

 

Thank you

Developer
Posts: 16,992
Registered: ‎07-29-2008
My Device: Z10 LE, Z30, Passport
My Carrier: O2 Germany

Re: Automatically Update Application

you can download the cod-file and install it automatically using codemodulemanager.
----------------------------------------------------------
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
Developer
Posts: 37
Registered: ‎07-17-2008
My Device: Not Specified

Re: Automatically Update Application

I will check it out. Thank you Simon.
New Developer
Posts: 122
Registered: ‎09-04-2008
My Device: Storm II Model 9550
My Carrier: Developer

Re: Automatically Update Application

Hello All,

 

My application is running in background always. 

 

I am updating application automatically using CodemoduleManager, and i got "CodeModuleManager.CMM_OK_MODULE_OVERWRITTEN". But actually it is not updated. i.e. Old versiom is running on device only.

 

I use CodeModuleManager.promptForResetIfRequired(), but it doesnot do anything.

 

Then i manually restart the device by removing battery, then also old version is running on device only.

 

Can some one help me in this?

 

-Shekhar.

Developer
Posts: 241
Registered: ‎11-20-2008
My Device: Not Specified

Re: Automatically Update Application

I have the same problem. Any ideas?
Contributor
Posts: 10
Registered: ‎11-24-2010
My Device: 8520

Re: Automatically Update Application

 


simon_hain wrote:
i define the address of the jad-file in the application. a seperate thread downloads the beginning of the jad-file, gets the substring beginning with MIDlet-Version: and compares it to the local version. if it is different / bigger the user is prompted to download the newer version (invoke the browser with the jad).

 

I ve tried the same thing but there is a problem, it works on simulater but couldnt make it work on device.

 

Im trace out the http connection result, as i said nothing happens on device. Any idea what could be the problem.

Highlighted
Developer
Posts: 16,992
Registered: ‎07-29-2008
My Device: Z10 LE, Z30, Passport
My Carrier: O2 Germany

Re: Automatically Update Application

most likely you have a problem with your http connection. check out the sticky article about it.

----------------------------------------------------------
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: 10
Registered: ‎11-24-2010
My Device: 8520

Re: Automatically Update Application

 


simon_hain wrote:

most likely you have a problem with your http connection. check out the sticky article about it.


Thanks, i m just reading...