Android:
http://developer.android.com/guide/topics/providers/content-providers.html
misc:
@in xml: need setup this for URI path in packet
Content Resolver can access it.
<provider android:name=".MyContentProvider"
android:authorities="com.paad.skeletondatabaseprovider"/>
<provider android:name=".MySearchSuggestionsContentProvider"
android:authorities="com.paad.skeletonsearchabledatabaseprovider"/>
<provider android:name=".MyHoardContentProvider"
android:authorities="com.paad.hoardcontentprovider"/>
@CONTENT_URI
public static final Uri CONTENT_URI = Uri.parse("content://com.paad.skeletondatabaseprovider/elements");
@/< rownumber >,
content:// com.paad.skeletondatabaseprovider/ elements/ 5
@UriMatcher
init:
uriMatcher = new UriMatcher(UriMatcher.NO_MATCH);
uriMatcher.addURI("com.paad.skeletondatabaseprovider",
"elements", ALLROWS);
uriMatcher.addURI("com.paad.skeletondatabaseprovider",
"elements/#", SINGLE_ROW);
parser: check method:
switch (uriMatcher.match(uri)) {
@how to use the content provider
ContentResolver
No comments:
Post a Comment