Android content providers-create content providers (implementation contract class)

Source: Internet
Author: User

A contract class is a static class that contains definitions of constants for Uris, column names, MIME types, and other metadata of the provider. This class establishes a contract between the provider and other applications, so that the provision can be accessed correctly even if the actual Uri, column name, and so on are changed.

Contract classes are also helpful to developers, because their constants all help to remember the name, so for column names or Uris developers rarely use wrong values. Because it is a class, it can contain javadoc documents. The integrated development environment (such as Eclipse) can automatically name constants from contract classes and display javadoc to corresponding constants.

Developers cannot access the class files of contract classes from your applications, but they can statically compile a. jar file from your provided to their applications.

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.