Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Detect if an app was uninstalled

Tags:

android

Is there a way to get a system notification when an app has been uninstalled?

I would like to maintain a table of all clients' info currently using my app. However, that seems impossible if there is no way to detect this event.

The first solution I can think of is to have an always running service in the background listening for android.intent.action.PACKAGE_REMOVED. But then would that service be killed once the uninstallation process has ended, or would it be stopped just before the process has kicked off? Also even if this is a solution it's has the potential to put off a lot of people when they realise that part of the app is running in the background.

Any suggestions? Thanks!

like image 671
mobilekid Avatar asked Apr 21 '10 06:04

mobilekid


2 Answers

You could simply do it the other way round and maintain a table of users actively using your app. Just call a webservice at a point in the program that show it is active. If an app isn't used for a certain time mark it as inactive.

like image 63
Janusz Avatar answered Nov 14 '22 20:11

Janusz


The documentation for the PACKAGE_REMOVED action says the following:

The package that is being uninstalled does not receive this Intent.

So you can monitor for other applications being uninstalled but not your own.

So you'll probably need track who is still using your application, not who has stopped using it. If you don't want the overhead of having your own server to do this you could use a free service like Flurry.

like image 41
Dave Webb Avatar answered Nov 14 '22 20:11

Dave Webb