Android implementation of permanent data preservation method _android
Source: Internet
Author: User
Background: In the way that data is stored in Android, you can divide it into the following
Content Provider (implemented with the SQLite), Sqlite,sharedpreferences (implemented in XML), files, networks, and other means.
Today in the project, you need to make a permanent saved data, save it locally. They then tested these methods of preservation.
Where: Sharedpreferences, SQLite, Content Provider will delete the file when you click "Erase Data" in "Settings"-"Application Management". So it's not safe.
File system: If the SD card is broken, or when it is unplugged, data will be lost.
Workaround: Save the data to the SD card (considering that the SD card can hold all kinds of complex data, and the capacity is larger than other storage modes),
To get the data, first get to the SD card, if no more to the online data to save locally.
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