Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Upgrading running application on Android

Is Android system supposed to restart an application when it's upgraded while it's running?

When we upgrade our application (by opening the .apk from SD card) and the application is running, the existing process stays around and the upgrade does not take effect until we "force close" the application from application manager. However it is likely that the application is in some weird state and may not respond to some intents it should. So I want to know whether the application would be restarted if we fix that particular broken state or whether we need to handle the upgrade ourselves.

Note, that I know (or at least have some ideas) how to detect the upgrade programmatically. What I want to know is whether I am supposed to or whether there is some other mechanism that should do it if the application is in a sane state.

like image 836
Jan Hudec Avatar asked Jun 02 '11 09:06

Jan Hudec


People also ask

Can you force an app to update?

Half a year ago, at the Android Dev Summit, Google announced a new way for developers to force their users to update their apps when they launch new features or important bug fixes.

How do I upgrade an APK file?

Go to Miradore > Management > Applications and choose the application. When you want to update your devices with a new version, select the version and open the Version page. If you want to update the new version only to specified devices, choose Actions > Update application.


1 Answers

Is Android system supposed to restart an application when it's upgraded while it's running?

I dont know what should be the expected behaviour. But I know that it does not restart the app. So I have a BroadcastReceiver waiting for the ACTION_PACKAGE_REPLACED intent and then handle the app restart accordingly.

like image 173
Vino Avatar answered Sep 16 '22 22:09

Vino