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).
精彩评论