Five ways to store Android data

Source: Internet
Author: User
Android provides 5 ways to store data (1) using sharedpreferences to store data, which is a mechanism provided by Android to store simple configuration information in an XML format that stores data in the device. Can only be used within the same package and cannot be used between different packages. Sharedpreferences storage, which is a mechanism provided by Android to store some simple configuration information, such as the user name and password of the logged-in user. It uses the map data structure to store the information, stored as a key value, and can be read and written in a simple way. Storage directory/data/data/package name/shared_pref (2) file store data, file storage is a more common method, the method of reading/writing files in Android is exactly the same as the program that implements I/O in Java, The Openfileinput () and Openfileoutput () methods are provided to read the files on the device. Storage directory/data/data/package name/files (3) SQLite database stores data; SQLite is a standard database with Android, it supports SQL statements, it is a lightweight. Storage directory/data/data/package name/database (4) uses ContentProvider to store data, primarily for data exchange between applications, enabling other applications to save or read this content Various data types for provider. (5) Network storage data, upload (store) and download (obtain) The data we store in cyberspace through the storage space provided to us on the network. (Xml,json)

Five ways to store Android data

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.