Warm tip: This article is reproduced from serverfault.com, please click

Is there a way to automatically update application on Android?

发布于 2010-06-16 22:57:39

I'm developing an application that will most likely be preinstalled on devices. It will be also available on Google Play. Is there a way to update those instances that are not downloaded through Google Play, since Google Play won't notify users about an update.

I was thinking about, as suggested here, trying to contact my site periodically, and when update is available, download it.

Is there a way to do this update automatically, or even silently, so that user doesn't have to do anything (like running the package manually). Or, when my site shows update is available, to offer users an update through Google Play, even though it's not installed through Market (EDIT: This Google play option would be preferable, because than users wouldn't have to check "allow install of non-Market sources".)

Questioner
Levara
Viewed
0
Jorgesys 2012-03-23 01:00:45

i had the same issue, now i check at the start of my app if theres a new version in my configuration xml.

I compare the actual version with the tag "< app_version >1.1< /app_version >" of my configuration.xml if its lower i ask with a custom AlertDialog if the user proceed with the upgrade

Intent intent = new Intent(Intent.ACTION_VIEW ,Uri.parse(myapk_link));
startActivity(intent);    

after the download the user has to run the package manually.

if you choose the update from the Android market use:

Intent intent = new Intent(Intent.ACTION_VIEW ,Uri.parse("market://details?id=com.package.name"));
startActivity(intent);  

com.package.name must be the "package" of your app

or

Intent intent = new Intent(Intent.ACTION_VIEW ,Uri.parse("market://search?q=" + APP_NAME));
startActivity(intent);