0

I want to develop code which can be integrated with my blackberry applications. This will check server whether is there any new versions available and if it finds one, then it will automatically download, install or replace the old version, run the newly installed app.

The goal is no user input required.

Michael Donohue
  • 11,776
  • 5
  • 31
  • 44
Kashif Ilyas
  • 136
  • 1
  • 2
  • 7

2 Answers2

4

The following suggestion works for OTA installations. I'm not sure how BlackBerry World handles this.

You can have a service that returns the latest version of the application. The application will call this service at startup(or once a day/week/month - however you want to define this). Then you make this check:

if(serverReturnedVersionNumber>currentApplicationVersionNumber) {
    //popup to ask if user wants to upgrade?
    BrowserSession browser = Browser.getDefaultSession();
    browser.displayPage(urlToDownloadNewVersion);
    System.exit(0);
}

The urlToDownloadNewVersion should return a text/vnd.sun.j2me.app-descriptor mime-type(that's a .jad file) that should install the new version of your app(OTA installation).

Mugur
  • 1,019
  • 9
  • 21
1

I think blackberry app world takes following steps when you download any application from blackberry app world.

  1. download cod files from the server.
  2. save that code files in local file system and apply enableDRMForwardLock() .
  3. using CodeModuleManager install cod files.
  4. using

    codeModuleGroup.setProperty(String name, String value) set the jad properties. like RIM_APP_WORLD_NAME, RIM_APP_WORLD_UPDATE_AVAIL

So i think you can do 3 things.

a) if your application is on blackberry app world, read the jad attribute RIM_APP_WORLD_UPDATE_AVAIL and launch blackberry app world.

Interface with the BlackBerry App World

b) Launch browser as suggested by Mugur.

c) Like blackberry app world download cod files, install that cod files and uninstall your current application. Programmatically install and upgrade applications

Vivart
  • 14,900
  • 6
  • 36
  • 74
  • Hi Vivart, are you sure of "c" option, means i can install app downloading and installing from within my app programmatically. I tried your c option and accordingly changed my code, app goes for a download and then timesOut after 120000 ms, before failing i read AppWorld related logs 0:10:31.944: [AppWorld] - 01/23 11:38:00 22 ERROR An error has occur while updating. Updater load() id1 null – Ankit Jan 23 '14 at 12:57