January 2017
Beginner to intermediate
1045 pages
22h 24m
English
Let's launch the FourGoats app and register a new user using the register option. Once created, login using the credentials, I have used username as test and test as its password, as shown following:

Shared Preferences are created using the SharedPreferences class. Below is the piece of code used to store the username and password in the credentials.xml file:
public void saveCredentials(String paramString1, String paramString2) { SharedPreferences.Editor localEditor = getSharedPreferences("credentials", 1).edit(); localEditor.putString("username", paramString1); localEditor.putString("password", paramString2); localEditor.putBoolean("remember", ...