Detect my own app's version or use existing update notifier when publishing on my website and not the market

StackOverflow https://stackoverflow.com/questions/3845774

  •  27-09-2019
  •  | 
  •  

Question

I would like to notify the users when there is an update because the updates will be coming from my own website and not the market. However, do not want to have to update two places.

Either that or I would like to share the existing update notifier that is included with android. I am planning on uploading the app to one of our websites instead of the market.

Thanks!

Was it helpful?

Solution

AFAIK there is no public API for this provided by the Android OS or by the Android Market app. Note that hardware vendors often bundle their own update apps for this very reason.

Your best bet is to put the APK on your web server for download. Every time you download it, record the date from the Last-Modified HTTP header. Then in future you can poll this file using If-Modified-Since if your server supports this tag, if it doesn't you can get the header and check the Last-Modified date programmatically without downloading the HTTP contents.

Once you know an update is available, you can notify the user with your own notification code. If you plan to update the app programmatically, you will need to make sure you request the android.permission.INSTALL_PACKAGES permission in your manifest.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top