0

I have developed one application and made the apk of that app.Now I want to give password to that so that when anyone will try to install the application it will ask for the password.

user1522869
  • 109
  • 2
  • 13

2 Answers2

0

You can't protect apk files that way, however you can add a screen to your application that "validates" the install, this is where they should enter a password which should be entered just once and remember this.

FabianCook
  • 20,269
  • 16
  • 67
  • 115
  • 1
    Do you have the source of the application? I would create an activity that checks if the password has been entered, I would use something like an encysted string and shared preferences, do a bit of research, it's all there for you. Look at splash screens or what's new dialogs, should give you an idea of how to do it just once. – FabianCook Sep 25 '12 at 06:13
  • how to set the login screen would you please help me – user1522869 Sep 25 '12 at 06:37
  • Thats a whole new question... open a new question up, this should be your answer for this one, for the other question use this... title:`Log in screen on first start` question:`how would you create an activity that only runs when the application is started for the first time ever and provides the user with a screen to input a pin and "unlock" the application` – FabianCook Sep 25 '12 at 06:46
0

You cannot simply do this. Are you trying to licence your software? If so, create a Splash Screen with some login credentials or an EditText field where the user types in a licence key. Make sure that the splash screen has the right Intent Filter, as well:

    <activity
        android:name=".Splash"
        android:theme="@android:style/Theme.Black.NoTitleBar" 
        android:screenOrientation="portrait">
        <intent-filter>
            <action android:name="android.intent.action.MAIN" />
            <category android:name="android.intent.category.LAUNCHER" />
        </intent-filter>
    </activity>
Tobias Moe Thorstensen
  • 8,861
  • 16
  • 75
  • 143