Uninstallation password
I am making one phone security application in android. The point where I stuck is that How to set uninstall password for this app. When application is installed user can set the security password and this password will be used for uninstalling this app. So please someone suggest me how to put code for uninstall event.? Is there any event or ser开发者_StackOverflowvice called when apps are going to uninstall.?
No, sadly there is no uninstall event that you can catch for your own app.
You can only watch the installation and uninstallation of other apps via the Intent.ACTION_PACKAGE_ADDED (and similar) broadcast(s).
Maybe you can use a deamon runing in background, that can intercept the uninstall of you application.
This deamon would be executed when the phone turns on, or when your application is used.
To run an application when booting your phone: http://www.androidcompetencycenter.com/2009/06/start-service-at-boot/
Refer to Intent.ACTION_PACKAGE_ADDED (and similar) broadcast(s)
as alextsc
said. (sorry cannot add comments)
android does not give you freedom to perform code when app is uninstalled.
All the settings and application data is deleted which is set by the applicaion
The only thing that will persist is the data that is written to the SD-Card and the changes to phone settings
精彩评论