Android content providers-create content providers (design data storage)

Source: Internet
Author: User

The content provider is an interface that stores data in a structured format. Before creating an interface, you must decide how to save the data. You can store the data in any format you like, and then design the interface necessary for reading and writing data.

The following are effective data storage technologies on the Android platform:

1. The Android system includes an android SQLite database API used to save table-oriented data. The sqliteopenhelper class helps you create databases. The sqlitedatabase class is the base class for accessing databases. Remember, you do not have to use a database to implement your resource library. The provider uses a set of tables similar to relational databases as external representations, but the internal implementation of the provider is not necessary.

2. Android provides various file-oriented APIs for saving file data. To learn more about file storage, read the "Data Storage" topic. If you are designing a provider that provides music, video, and other multimedia data, you can combine data tables and files;

3. for network-based data, use classes in java.net and android.net. You can also synchronize network-based data to local storage, such as a local database, and then provide data in the form of tables or files. Sample sync adapter Sample ApplicationProgramDemonstrate the synchronization type.

ExampleCodeLocation: http://developer.android.com/resources/samples/SampleSyncAdapter/index.html

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.