Android Data storage

Source: Internet
Author: User

Overview

The 1.android contains 5 of data storage methods:

Sharedpreferences stores data.

ContentProvider Storage

File storage

Sqllite Database Storage

Networked storage

Preference File DataBase These three ways correspond to the directory is:

/data/data/package Name/shared_pref

/data/data/package Name/files

/data/data/package Name/database

Simple data and configuration information, sharedpreference is preferred;

If Sharedpreferences is not enough, create a database;

Structured data, be sure to create a database, although this slightly annoying lock, but the benefits are endless;

Files are used to store files (that is, non-configuration information or structured data), such as text files, binaries, PC files,

multimedia files, downloaded files and so on;

Try not to create files;

If a file is created, if it is a private file or an important file, it is stored on-premises, otherwise it is stored in an external storage

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.