
Question:
I want to create an application that prompts the user to create a password before the application is installed and also before the application can be uninstalled the password must be entered. I have ran out of ideas on how to go about the code. Please can anyone give me a code and an insight on how to go about this_ I would appreciate a lot.
Answer1:You can use shared preference/db to have default value and see if there is a default value you can prompt dialog
Answer2:<blockquote>
I want to create an application that prompts the user to create a password before the application is installed
</blockquote>To be clear you said BEFORE the app is installed. This might be Possible. But "dirty". In the user journey your user downloads and installs the APK from the market or where ever. None of your app code has run yet so there's nothing to leverage.
A possible work around, which I have heard others use but not tried myself so no guarantees, is to write a login app that when installed prompts for password creation and on success downloads the actual app.
I would probably say - why? What it the motive behind doing this? Lots of apps work fine installing the whole app (Spotify comes to mind).
Answer3:I don't think this is possible the android market takes downloads and installs or user installs some other way and the user uninstall via manage application in the settings, all of these things happen outside of the scope of an app
Answer4:See <a href="http://developer.android.com/guide/topics/admin/device-admin.html#code" rel="nofollow">Device Administrations API</a>