tags:

views:

436

answers:

4

Hi,

I'm developing an application that will most likely be preinstalled on devices. It will be also available on Market. Is there a way to update those instances that are not downloaded through Market, since Market 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.

I'm wondering if there is a way to do this update automatically, 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 Market, even though it's not installed through Market.

EDIT: This Market option would be preferable, because than users wouldn't have to check "allow install of non-Market sources".

Thanks!

A: 

You cannot install or upgrade a package automatically. Only the Android Market is capable of doing this (i.e. it silently updates itself).

You can certainly download a package and fire the Intent to install it, but the user will have to have the "Allow non-Market apps" options enabled, and they'll still have to manually approve the install/upgrade.

One place to possibly investigate is how Google Maps does it. This is generally pre-installed, but always appears to be shown as an update in the Android Market app, I believe. Whether there's a special flag in the packages.xml or manifest, I don't know.

Christopher
Thanks, I'll try to investigate that.
Levara
A: 

Hi Levara, 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.

Jorgesys
That is pretty much what I had on my mind. Still a bit too complicated for the users... Thanks
Levara
+1  A: 

I'm developing an application that will most likely be preinstalled on devices.

Then you need to be talking to the device manufacturers and asking them your questions. Nobody else will be able to tell you what is and is not possible, given their device and the carrier(s) that will distribute it. The answers will depend heavily on how they create their firmware, whether your application will be part of the firmware or "installed" as a normal app, what their arrangement with the carrier is vis a vis firmware updates, etc. You may not even get a vote in the matter.

CommonsWare
"You may not even get a vote in the matter." I don't... That's why I'm looking for an alternative way... :P
Levara
+1  A: 

Just found a way that works. Fire an Intent for a Market that searches for my application.

Tested with OpenIntent Newsreader because for it was easy to find an older version .apk. Market finds an application, and when user clicks install, replaces older version with the one from the Market. I think that is much easier solution for a user than downloading manually .apk and running it.

Intent intent = new Intent(Intent.ACTION_VIEW ,Uri.parse("market://search?q=" + APPLICATION_NAME));
startActivity(intent);  
Levara
And what if there's no Market (i.e. Google Apps) on device?
zed_0xff
All my users should have Market installed. I guess, if that isn't the case, Jorgesys's answer is the only option.
Levara