[Android] shared preferences for data storage

Source: Internet
Author: User

Android provides four data storage methods:

  • Shared preferences: used to store data in the "key"-"value" format. It is a lightweight key-value storage mechanism that can only store basic data types.
  • Filws: file storage
  • SQLite: a standard database provided by android that supports SQL statements
  • Network: stores and obtains data through the network.

Shared preferences is mainly used to save system configuration information. For example, when a user logs on, the user name and password are entered, and the input content is retained at the next login.

Files stores all the things to be saved in the file. If necessary, you can obtain them by reading the file.

SQLite is an open-source relational database that can store a large amount of data and easily add, delete, modify, and query data.

The data stored in the preceding methods is private to the application. To use the data in other applications, you must use the contentproviders (Data Sharing) provided by Android ).

Write this file first. It is not finished yet.

Related Article

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.