Android Basics Summary (5)--data storage, persistence technology

Source: Internet
Author: User
  • instantaneous data : Refers to data that is stored in memory that may be lost due to program broadcasts or other causes of memory being recycled.
  • data Persistence : means that the instantaneous data in memory is saved to the storage device, ensuring that the data is not lost even when the phone or computer shuts down.

The data stored in memory is instantaneous, and the data stored in the device is persistent, and the persistence technology provides a mechanism for the data to switch between the transient state and the persistent state. The Android system offers three ways to simply implement data persistence:

  1. file Storage : Is the most basic form of data storage in Android. no formatting is done on the stored content, and all data is saved intact to the file . Therefore, this approach is more appropriate than storing some text data or binary data . If you want to use file storage to save more complex text data, you need to define a set of formatting specifications, which makes it easy to re-parse the data from the file.
  2. sharedpreference Storage :
  3. Database Storage :

In addition, we can also store data in an SD card . However, using these three methods is simpler and more secure.

Android Basics Summary (5)--data storage, persistence technology

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.