Content URI Summary

Here is a recap of the important parts of a content URI:

content://com.example.transportationprovider/trains/122

A. Standard prefix indicating that the data is controlled by a content provider. It's never modified.

B. The authority part of the URI; it identifies the content provider. For third-party applications, this should be a fully-qualified class name (reduced to lowercase) to ensure uniqueness. The authority is declared in the <provider> element's authorities attribute:

<provider name=".TransportationProvider"

authorities="com.example.transportationprovider" >

C. The path that the content provider uses to determine what kind of data is being requested. This can be zero or more segments long. If the content provider exposes only one type of data (only trains, for example), it can be absent. If the provider exposes several types, including subtypes, it can be several segments long — for example, "land/bus", "land/train", "sea/ship", and "sea/submarine" to give four possibilities.

D. The ID of the specific record being requested, if any. This is the _id value of the requested record. If the request is not limited to a single record, this segment and the trailing slash are omitted:

content://com.example.transportationprovider/trains

Except as noted, this content is licensed under Apache 2.0. For details and restrictions, see the Content License.

Site Terms of Service - Privacy Policy - Brand Guidelines

0 0

Post a comment