Android data store-remember password operation via sharedpreferences

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.