您的位置:首页 > 移动开发 > Android开发

android-Creating a Content Provider(2)

2015-11-28 19:04 381 查看
For content URIs that point to a row or rows of table data,
getType()
should
return a MIME type in Android's vendor-specific MIME format:

Type part:
vnd

Subtype part:

If the URI pattern is for a single row:
android.cursor.item/

If the URI pattern is for more than one row:
android.cursor.dir/


Provider-specific part:
vnd.<name>
.
<type>

You supply the
<name>
and
<type>
. The
<name>
value should be globally unique, and the
<type>
value should be unique to the corresponding
URI pattern. A good choice for
<name>
is your company's name or some part of your application's Android package name. A good choice for the
<type>
is a string that identifies the table associated with the URI.

Attributes that specify the permissions that other applications must have in order
to access the provider's data:

android:grantUriPermssions
: Temporary permission
flag.
android:permission
: Single provider-wide read/write
permission.
android:readPermission
: Provider-wide read
permission.
android:writePermission
: Provider-wide write
permission.

Permissions and their corresponding attributes are described in more detail in the section Implementing
Content Provider Permissions.
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: