Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to start an Activity or Service before an App application is uninstalled by the User?

Tags:

android

Why the same question again

This question has been asked around 100 times on SO. I am asking it again because all the answers say this is not possible but at least one of the app in Market is doing it NQ Mobile Security. I started a bounty of 100 points on the similar question but it did not get enough attention. If community does not accept I will remove the question.

What is the App doing

The app shows an activity when user tries to uninstall it

enter image description here

and does some processing before it is uninstalled

enter image description here

What is my Question

How to start an Activity or an IntentService before an application in uninstalled by the user who has earlier installed the app on her device?

like image 819
Gaurav Agarwal Avatar asked Jun 16 '12 10:06

Gaurav Agarwal


3 Answers

As @CommonsWare said The techniques used by NQ Mobile Security have been reported to the Android Security group, and they are working on a fix to stop this behavior from occurring. and have raised a feature request with Google hopefully they may listen to it.

http://code.google.com/p/android/issues/detail?can=2&q=33315&colspec=ID%20Type%20Status%20Owner%20Summary%20Stars&id=33315

like image 90
Gaurav Agarwal Avatar answered Oct 06 '22 00:10

Gaurav Agarwal


I think that you can track logcat, where all activities, events, intents are registered and and find when an Intent is sent to uninstall this app.

Then you could possibly perform an action, i.e. launch an Activity, but I am not sure for this step.

Hope this helps!

like image 31
Dimitris Makris Avatar answered Oct 06 '22 00:10

Dimitris Makris


I don't know how it happen in NQ Mobile Security application,

But in general case I found it not possible (Or may be possible but I couldn't find the way),

Because,

When you register BroadcastReceiver for android.intent.action.PACKAGE_REMOVED in your own app and when the app is uninstalled, the registered BroadcastReceiver has been uninstalled before the app gets uninstalled,so its own uninstallation event won't be received by that BroadcastReceiver.

like image 41
user370305 Avatar answered Oct 06 '22 01:10

user370305