Android content providers'-content providers' BASICS (Contract class ))

Source: Internet
Author: User

Contract class)

The contract class defines some features that use content resource identifiers (URIs), column names, intent actions, and content providers to help applicationsProgramA constant of work. Contract classes are not automatically included with providers. providers must define them and make them valid for other developers. The Android platform contains many providers' corresponding contract classes in the Android. provider package.

For example, the user dictionary provides a contract class that contains the content resource identifier (URI) and column name constants. The content resource ID for the "Words" table is defined in the constant userdictionary. wordscontent_uri. The userdictionary. Words class also contains column name constants used in this example. For example, the query projection can be defined as follows:

String [] mprojection =
{
Userdictionary. Words. _ id,
Userdictionary. Words. Word,
Userdictionary. Words. locale
};

Another contract class is the contactscontract class of the Communication record provider. One of its subclasses, contactscontract. intents. insert is a contract class that contains constants for intent objects and intent data.

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.