0

Want to develop an Android App which will ask for password when user install the app and uninstall the same. Can i actually develop the app like this?

  • you mean like a login/logout ? You can´t hinder anyone from uninstalling your app. When should the password prompt appear according to your definition ? You can´t take action before an activity is launched – Christian Stengel Jun 22 '16 at 08:48
  • actually want to develop an app which the Admin can install and uninstall on the user's mobile by entering the password. user cannot uninstall the app and cannot install the app in another mobile by sharing the apk. – Yogesh Verma Jun 22 '16 at 09:06

2 Answers2

1

You could use an <intent-filter> to detect when the user is trying to uninstall the app.

A similar question has been answered in a detailed way here.

Community
  • 1
  • 1
n0idea
  • 732
  • 1
  • 5
  • 14
  • will it ask for password on installing the apk? – Yogesh Verma Jun 22 '16 at 09:01
  • If you check the answer you will see that it is actually possible, with a few tricks, to intercept an uninstall event for the app; you will have to write your own code to ask the user to set a password after the app is installed (i guess that's what you're asking for) and also check it before uninstalling it. – n0idea Jun 22 '16 at 10:17
0

Yes, that is possible. You can find examples on github, for example this application: appLock.

Important part is here: AppLockImpl.java

vanste25
  • 1,754
  • 14
  • 39