In the Android login, in order to realize the user's convenience, often need to follow the user's needs to remember the password operation, so, in the Android data storage sharedpreferences exactly can achieve this
Below, the small series will lead you to realize the operation of remembering the password through sharedpreferences
First: The introduction of what is Sharedpreferences?
Sharedpreferences is a lightweight storage class on the Android platform that holds some of the most common configurations for your app.
Second, introduced the sharedpreferences, we will remember the sharedpreferences case to tell Sharedpreferences
Analysis: When the user first login, if click Remember Password operation, the account password is saved to the XML, if not clicked, then do not save, or save the null value into the XML (for security purposes, the proposed data storage encryption algorithm, commonly used MD5 encryption, BASE64 encryption, Small in this not to tell--#)
Case:
The actions implemented by this case are as follows
Code: such as
Analysis: First declare the Sharedpreferences object, then call the edit () method, each time the use is completed must commit ()
----
SOURCE Hosting: Https://coding.net/u/monsterLin/p/SharedPreferences_Demo/git
Android data store-remember password operation via sharedpreferences