First, Some Dissection

 

As was discussed in the previous chapter, the content is the linchpin behind accessing data inside a content provider. When using a content provider, all you really need to know is the provider’s base ; from there you can run queries as needed or construct a to a specific instance if you know the instance identifier.

When building a content provider, though, you need to know a bit more about the innards of the content .

A content has two to four pieces, depending on the situation:

• It always has a scheme (), indicating it is a content instead of a to a Web resource ().

• It always has an authority, which is the first path segment after the scheme. The authority is a unique string identifying the content provider that handles the content associated with this .

• It may have a data type path, which is the list of path segments after the authority and before the instance identifier (if any). The data type path can be empty if the content provider handles only one type of content. It can be a single path segment () or a chain of path segments () as needed to handle whatever data‑access scenarios the content provider requires.

• It may have an instance identifier, which is an integer identifying a specific piece of content. A content without an instance identifier refers to the collection of content represented by the authority (and, where provided, the data path).

For example, a content could be as simple as , which would refer to the collection of content held by whatever content provider was tied to the authority (e.g., ). Or, it could be as complex as , which would refer to a piece of content (identified as 17) managed by the content provider that is of the data type .

 








Дата добавления: 2015-05-16; просмотров: 606;


Поиск по сайту:

При помощи поиска вы сможете найти нужную вам информацию.

Поделитесь с друзьями:

Если вам перенёс пользу информационный материал, или помог в учебе – поделитесь этим сайтом с друзьями и знакомыми.
helpiks.org - Хелпикс.Орг - 2014-2024 год. Материал сайта представляется для ознакомительного и учебного использования. | Поддержка
Генерация страницы за: 0.003 сек.