This question already has an answer here:
How to start an Activity ,Service or broadcast receiver before an application uninstalled by the user who has earlier installed the app on his/her device?
If possible please help me? and thanks in advance
This question already has an answer here:
How to start an Activity ,Service or broadcast receiver before an application uninstalled by the user who has earlier installed the app on his/her device?
If possible please help me? and thanks in advance
Yes you can create a broadcast receiver for package add/remove and start a service from it.
register your broadcast in manifest file as like this
or you can register it via java code
hope this answer is helpful to you friend :)
No dear you cant check that your application is going to uninstall.
When the user uninstalls the app, at first the process is killed, then your apk file and data directory are deleted, along with the records in Package Manager that tell other apps which intent filters you've registered for.
But you can create your folder in your cache dir so that when your application will be deleted all folders and files automatically will be deleted.
Please check it. http://developer.android.com/guide/topics/data/data-storage.html
So there's no way for your application to know that it is being uninstalled (without modifying the kernel). All files created in the data/data/your.app.package is deleted automatically upon uninstall.
Another approach could be to have another application that checks whether this application is installed or not. If not, it can do the clean-up work.
like this
You can't detect for your app whether it has installed or uninstalled but for other apps you can get this detail using this
BroadcastReceiver
.YES using Accessibility Service you can detect Uninstall event and then read rhe screen to find app name. Voodo app uses this concept.