How to implement auto-update feature in blackberry

2019-04-17 03:39发布

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.

2条回答
孤傲高冷的网名
2楼-- · 2019-04-17 04:25

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).

查看更多
在下西门庆
3楼-- · 2019-04-17 04:29

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

查看更多
登录 后发表回答