So let's say I'm in charge of developing a custom, internal android app that will be installed via APK. What's a good way to have this thing check for updates on startup? Should I just have it know it's version number and make a custom http request to see if a new version is available? Are there best practices for this kind of thing?
Asked
Active
Viewed 60 times
0
-
Check this out.. https://github.com/commonsguy/cwac-updater – Hardy Jul 10 '14 at 14:05
-
And this: http://stackoverflow.com/questions/3057771/is-there-a-way-to-automatically-update-application-on-android – Hardy Jul 10 '14 at 14:08
-
cwac-updater is no longer being maintained and if I was going to maintain that much code I would rather write it from scratch than take over their project. The other stackoverflow post is related to an app that's available on Google Play which mine is not. Thank you for your efforts!! – ErlVolton Jul 10 '14 at 14:11
-
The second link i provided includes methods for updating both.. from app store or not.. See: http://stackoverflow.com/a/3057965/2611927 – Hardy Jul 10 '14 at 14:15
1 Answers
0
I would do this by creating text file (xml/json) like:
app.xml
<app>
<date>1.1.2014</date>
<version>1.1</version>
<apk>http://someurl.com/my_app.apk</apk>
</app>
Then when you update your app just upload it to your server and change that xml file to match new apk details.
In your app you just download that xml (in startup or in background as service) and compare the version to current app version and if newer version is available just notify user and download it from app like:
Intent intent = new Intent(Intent.ACTION_VIEW ,Uri.parse(myapk_link));
startActivity(intent);

Hardy
- 5,590
- 2
- 18
- 27