标签:
一个程序可以通过实现一个Content provider的抽象接口将自己的数据完全暴露出去,而且Content providers是以类似数据库中表的方式将数据暴露。
要想使应用程序的数据公开化,可通过2种 方法:
1)创建一个属于你自己的Content provider
public boolean onCreate()public Uri insert(Uri uri, ContentValues values)public int delete(Uri uri, String selection, String[] selectionArgs)public int update(Uri uri, ContentValues values, String selection, String[] selectionArgs)public Cursor query(Uri uri, String[] projection, String selection, String[] selectionArgs, String sortOrder)public String getType(Uri uri)}
<manifest .... ><application android:icon="@drawable/icon" android:label="@string/app_name"><provider android:name=".PersonContentProvider" android:authorities="cn.itcast.provider.personprovider"/></application></manifest>
标签:
原文地址:http://www.cnblogs.com/yedushusheng/p/4333929.html