Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Perform a task on uninstall in android [duplicate]

I have developed an Android app. Now I want to perform a few operations (i. e. - Reset the settings etc.. ) at the moment the app gets uninstalled from the phone.

Is it possible to reigster a listener or a function that is called at the moment the app is removed?

like image 396
dhaiwat Avatar asked Jun 10 '10 11:06

dhaiwat


People also ask

How do I stop accidental uninstall on Android?

Use AppLock If you want to block users from uninstalling specific apps, scroll down to General. Then, simply lock the respective app(s). Once the app locked, users won't be able to launch it or uninstall it.

How do I uninstall Android system apps that won't uninstall?

If you can't find the option yourself, use your phone's built-in search function in the Settings menu. See if the app in question is marked with a tick. If so, disable it. Now go to your apps manager – the application should now be uninstallable.

Is it possible to detect Android app uninstall?

Detection of app uninstalls can be made by sending silent push notifications. Notifications that are not created on the devices of the app users are called silent push notifications. You can keep track of app uninstalls by sending silent push notifications to all devices where your app is installed.


2 Answers

Sadly android at the moment does not give you a possibility to perform code at the moment your app is uninstalled.

All the settings that are set via the SharedPreferences are deleted together with everything in the Application Data an Cache folder.

The only thing that will persist is the data that is written to the SD-Card and any changes to phone settings that are made. I don't know what happens to data that is synchronized to the contacts through your app.

like image 161
Janusz Avatar answered Sep 26 '22 12:09

Janusz


You cannot get control when your application is uninstalled -- sorry!

like image 27
CommonsWare Avatar answered Sep 22 '22 12:09

CommonsWare