local - Saving facebook login details locally in android app -


I'm developing an Android app where the user has the ability to share Facebook. I have user login details for Facebook, now what I am trying to do, these login details should be saved until the application is removed.

When I tried to find an answer for it, I got some answers about the shared preferences. But I'm not exactly sure how it works.

What I'm trying to do here,

  username = username.getText (). ToString (); Passwords = passwords.gate text (). ToString ();   

Where username and password are 2 editors fields when the user enters Facebook for the first time, then these data should be saved somewhere for my future reference so that they do not have to re-enter Need to do

How can someone get me this?

  // Share your information SharedPreferences settings = get obtained reference ("my_file_name ", 0); SharedPreferences.Editor Editor = settings.edit (); Editor.putString ("Username", username.getText (). ToString ()); Editor.putString ("password", password.getText (). ToString ()); Editor.commit (); // Get the information to be shared in your information = received references ("my_file_name", 0); String Username = settings.getString ("Username", ""); String password = settings.getString ("password", "");   

A file will be created in:

  data / data / [your.package.path] / shared_prefs / [your.package.path] _preferences .xml    

Comments

Popular posts from this blog

mysql - BLOB/TEXT column 'value' used in key specification without a key length -

c# - Using Vici cool Storage with monodroid -

python - referencing a variable in another function? -