Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Force update my android application

Tags:

android

I am trying to force update my application before login, if there is any updated version available. I can check for update and able to install application in device, I replace my old version with updated one, at the end of all this process I want to open/invoke my application automatically not manually, (I can open my application manually), I can not use sqlite database to maintain somedata from application or any other APK which will force to invoke my application forcefully.

Any suggestion would be highly appreciable.

Thanks.


As I mentioned in my question that i can update application by installing new apk file from my server, even i know that android market handles the installation and will ask to invoke application, but in my case I have to do the same on my staging server to test my application by process. I am able to check for update and install application from my staging server, to updated apk installation my old version get uninstall and there is no way I have to invoke my new version application.

Any suggestion would be appreciable.

like image 712
Puneet Avatar asked Jan 30 '26 01:01

Puneet


1 Answers

You could easily call a web service from your app to find out if a newer version is available and to direct users to download it via the Android Browser. One advantage of this approach is some control over upgrade rate rather than the 'big bang' approach which is all that is supported by the Market.

something like

http://example.com/update.jsp?versionCode=3

where the versionCode comes from the manifest version. Then I would have the service either return blank (no update) or a URL to which the user should be directed to get the new apk.

You can have version code from

        getPackageManager().getPackageInfo(getPackageName(), 0).versionCode 

Please trigger a new intent to visit the URL. The user then gets sent to the browser which downloads the apk

like image 172
Sharmilee Avatar answered Feb 01 '26 16:02

Sharmilee



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!