2

I am developing the android application in which

  1. The application has a stored password (set by user when application is first installed)

  2. My application is the device administrator

The issue is when user clicks on uninstall of this application , i want user to input the password of the application

The process i will follow there after is :

  1. Show password Page
  2. Remove Device admin Rights by certain code
  3. Allow un-installing

Please help me with the detection of the uninstall click of my application to shoot the password page.. !!

Thanks in advance !

Bill the Lizard
  • 398,270
  • 210
  • 566
  • 880
rolling.stones
  • 496
  • 3
  • 9
  • 20

1 Answers1

1

Do you mean to intercept the uninstall of your app, and query for a password? That is not possible. Similar questions has been asked before, for example here.

Edit: It does seem as some related things can be done by making your application a Device Admin Application:

"To uninstall an existing device admin application, users need to first unregister the application as an administrator."

However I am not familiar with the restrictions that comes with this, and if it allows your exact use case.

Community
  • 1
  • 1
pgsandstrom
  • 14,361
  • 13
  • 70
  • 104
  • How is application like **kaspersky parental control** able to show similar password page and then only allow **un-install** of the application – rolling.stones Jun 13 '12 at 14:11
  • YES EXACTLY USER NEEDS TO UNREGISTER THE APPLICATION AS THE DEVICE ADMIN. APPLICATION IS THE DEVICE ADMIN...MY QUESTION IS STILL TO DETECT THE EVENT OF UNINSTALL OF THE APPLICATION SO AS TO LAUNCH AN ACTIVITY BEFORE THE PROCESS ??? :( – rolling.stones Jun 14 '12 at 12:26
  • 1
    To be clear, there is no way that you can prevent the user to uninstall your app without your permission. You can however make it a tad more difficult, as described in the link in my answer. – pgsandstrom Jun 14 '12 at 12:33
  • agreed sir , making it the device admin makes it difficult for user to uninstall. There are certain app's like anti theft (PREY) and parental app's like NORTON who call their password activity when clicked on uninstall ? EVEN APPLICATION is / not the device administrator...!! is there some way to figure it out... ? how is it possible ? – rolling.stones Jun 14 '12 at 12:38
  • This might be of interest for you: http://stackoverflow.com/questions/10219328/how-to-show-an-activity-before-my-app-is-uninstalled-android – pgsandstrom Jun 15 '12 at 21:29