开发者

Check version and install apk OTA if the version is different

I am trying to build this app which is almost complete now. I am trying to improve it by

  • Providing OTA support
  • In order to do that check the version, download apk and install it.

Some research pointed me to use Intents but was not very clear.

A step-by-st开发者_StackOverflow社区ep procedure will be much appreciated.

Thanks in advance.

PS: I may not be publishing it in the market because of certain requirements. So uploading to market is ruled out.


You can install an APK programatically by sending an intent with ACTION_VIEW with the apk file. This will open the application installer, which will install it if the build version in the manifest is higher than the one in the installed application.

See a similar question here for that part.

You'd need to poll a file on your server somewhere periodically that can return the latest version number, and compare it to the currently installed application version number through PackageManager (call getPackageInfo() and check PackageInfo.versionCode).

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜