Skip to content Skip to sidebar Skip to footer

Putting Password On An Android Class

i have been working on an sms application and i want to provide some private space for the user... which can only be accessed if the user enters the right username and password...h

Solution 1:

I think it can be easily achieved by using shared preferences.. to store the password for your application like this..

  SharedPreferences settings = getSharedPreferences("my_shared_pref", 0);
  String password = settings.getString("password", "empty");
  if(password == "empty"){

   //store the value in your edittext as password

   }
 else{
    //if string in edittext matches with the password value.. let the user enter the activity.. else make a toast of wrong password..
 }

Post a Comment for "Putting Password On An Android Class"