How to implement auto-update feature in blackberry

喜你入骨 提交于 2019-12-04 22:29:07

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

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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!