Content Providers, contentproviders

Source: Internet
Author: User

Content Providers, contentproviders

Content providers manage access to a structured set of data. they encapsulate the data, and provide mechanisms for defining data security. content providers are the standard interface that connects data in one process with code running in another process.

// Content provider is the standard interface for connecting data between two processes

When you want to access data in a content provider, you useContentResolverObject in your application'sContextTo communicate with the provider as a client.ContentResolverObject communicates with the provider object, an instance of a class that implementsContentProvider. The provider object names es data requests from clients, performs the requested action, and returns the results.

// When you want to access data in the content provider, you need to use the content resolver object as a client to communicate with the contentprovider server. Content resolver communicates with a provider object, which is an instance that implements contentprovider. This provider receives the client request, performs the request operation, and then returns the result.

You don't need to develop your own provider if you don't intend to share your data with other applications. however, you do need your own provider to provide custom search suggestions in your own application. you also need your own provider if you want to copy and paste complex data or files from your application to other applications.

Android itself registrdes content providers that manage data such as audio, video, images, and personal contact information. You can see some of them listed in the reference documentation forandroid.provider Package. With some restrictions, these providers are accessible to any Android application.

The following topics describe content providers in more detail:

Content Provider Basics
How to access data in a content provider when the data is organized in tables.
Creating a Content Provider
How to create your own content provider.
Calendar Provider
How to access the Calendar Provider that is part of the Android platform.
Contacts Provider
How to access the Contacts Provider that is part of the Android platform.

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.