Android study notes (8) ContentProvider

Source: Internet
Author: User

1. ContentProvider Concept

Basic concepts:
1. ContentProvider provides a unified interface for data storage and retrieval.
2. Use ContentProvider to share data between different applications.
3. Android provides ContentProvider (including audio, video, image, and address book) for common data)
 
Functions provided by ContentProvider:

 

Query ()

Query

Insert ()

Insert

Update ()

Update

Delete ()

Delete

GetType ()

Obtain the Data Type

OnCreat ()

Create a data callback function

 

2. Implementation of ContentProvider

 
The process of implementing ContentProvider:
1. Define a CONTENT_URI constant.
2. Define a class that inherits ContentProvider.
3. Implement the query (), insert (), update (), delete (), getType (), and onCreate () methods.
4. Declare in AndroidManifest. xml.

 

This article is from "suuu"
 

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.