This is how you can do this
Go through with these 2 URL this will help you
vogella.
mobile.tutsplus.com
Save
public void saveInformation(String username,String password) {
SharedPreferences shared = getSharedPreferences("shared", MODE_PRIVATE);
SharedPreferences.Editor editor = shared.edit();
editor.putString("username", username);
editor.putString("password", password);
editor.commit();
}
Load
private void LoadPreferences(){
SharedPreferences sharedPreferences = getPreferences(MODE_PRIVATE);
String username = sharedPreferences.getString("username", "");
String password = sharedPreferences.getString("password", "");
}
Edit
private void editDate(){
SharedPreferences.Editor editor = getPreferences(MODE_PRIVATE).edit();
editor.putString("username", mSaved.getText().toString());
editor.putInt("selection-start", mSaved.getSelectionStart());
editor.putInt("selection-end", mSaved.getSelectionEnd());
editor.commit();
}
To save multiple users data in will suggest you to create multiple files for each user and then save it in shared pref
Just go through with the diffrence between getDefaultSharedPreferences and getSharedPreferences from here Diffrence Link