1.ContentProvider provides a unified interface for storing and retrieving data
2. Use ContentProvider to share data between different applications
3.Android provides contentprovider for some common data (including audio, video, images, contacts, etc.)
ContentProvider to organize data using a table Form
_id |
number |
number_key |
label |
name |
type |
11 |
1348729883 |
2001 |
ss |
yd |
type_work |
12 |
15572706076 |
2011 |
s |
yy |
type_home |
Functions provided by ContentProvider
Query () queries
Insert () insertion
Update () Updates
Delete () remove
GetType () Get data type
OnCreate () callback function at the time of creation
the process of realizing ContentProvider
1. Define a Content_uri constant
2. Define a class that inherits ContentProvider
3. Implement query Insert update Delete GetType onCreate
4. Declaration in Androidmanifest.xml
This article is from "Avatar" blog, please make sure to keep this source http://shamrock.blog.51cto.com/2079212/1581614
Android Learning Note-contentprovider