(Android) Anatomy contentProvider-001

Source: Internet
Author: User
Tags export contacts

This article will show you how to study one of the four components of Android ContentProvider, as I will use contacts and calendars for the time being, introduce these 2 content first.

reproduced please indicate from the Http://my.oschina.net/moziqi/blog

First of all, I introduce the tools I use first, it is better to confuse the reader.

I use Eclipse+genymotion+sqlite Expert persional, in addition I based on android4.0 (14 version to get, the old version I will not introduce, you can refer to my this to learn the low version), I started the simulator is 4.4.4, But my church uses 4.0 of the documents, the difference should not be very big

First of course to start the corresponding software, if there is no corresponding software, you can download, especially genymotion This software, need to register to use,

After configuring the above things, at Eclipse launch Genymotion, open the Eclipse view File Explorer will appear as shown:

Expand Show open to data->data->com.android.provider.contacts, temporarily introduce this first

Export Contacts.db to outside, click contacts.db Press button, you can export, see how to Export

importing contacts.db into SQLite Export persional will show a lot of tables, as shown in

Since this table is Android comes with, we have seen here, it is necessary to understand what is called ContentProvider, in addition, we also need to understand the table in the field there are those, is for the development of bedding. And not just the table, but a few views.

In front of the field that says the table, let's introduce the next contacts Provider (Contact provider)

(Cite articles from official website)

Can turn over the wall, look at English children's boots It is best to go to see, do not know English, read and write domestic articles, deepen the understanding of these concepts.

The Contacts Provider is a powerful and flexible Android component that manages the device's central repository of data AB Out people.

This contacts Provider is a very powerful and flexible Android component. Manipulating Contacts

Contacts Provider Organization (structure chart)

There are 3 main tables

The three tables is commonly referred to by the names of their contract. The classes define constants for content URIs, column names, and column values used by the tables:

Contactscontract.contacts table

Rows representing different people, based on aggregations of raw contact rows.

Contactscontract.rawcontacts table

Rows containing a summary of a person's data, specific to a user account and type.

Contactscontract.data table

Rows containing the details for raw contact, such as email addresses or phone numbers.

The other tables represented by contract classes in Contactscontract is auxiliary tables that the Contacts Provider uses To manage IT operations or support specific functions in the device ' s contacts or telephony applications.

Raw can be translated into a source (for Google/Baidu), that is, the contact from there means it.


Open the source path, download it yourself, don't ask me how to download


Look at the source class you want to see

Forget it, do not want to grind rub, you yourselves left to go to self-study.

Read this article http://blog.csdn.net/qingye_love/article/details/9028503

(Android) Anatomy contentProvider-001

Related Article

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.