안드로이드 개발 질문/답변
(글 수 45,052)
ContentProvider쪽을 공부하고 있는데요. 여기서 보면 Content Type들에 아래와 같은 것들이 있습니다.
/**
* The MIME type of {@link #CONTENT_URI} providing a directory of notes.
*/
public static final String CONTENT_TYPE = "vnd.android.cursor.dir/vnd.google.note";
/**
* The MIME type of a {@link #CONTENT_URI} sub-directory of a single note.
*/
public static final String CONTENT_ITEM_TYPE = "vnd.android.cursor.item/vnd.google.note";
주석에는 이것이 MIME타입이라고 되어있기는 한데...제가 아는 MIME형식들이랑은 많이 다른거 같고...
잘 모르겠네요. 한참 웹과 포럼들을 돌아다녀도 모르겠고요....
저 MIME타입들이 어떤 규칙으로 정해진건지..또는 어디서 규칙이나 표준에 대한 정보를 찾아볼 수 있을까요?
설명이 어려운 것이면 레퍼런스될만한 사이트를 알려주세요.
읽어주셔서 감사합니다.
P.S
NotePad 예를 보면서 공부중인데요.
NotePad.java가 양쪽에 있어서 이거 무슨 이유로 양쪽에 있을까 한참 헤맸는데...
하나는 필요없는 거인거같네요...빼도 잘 동작하는 것이...음...제조사에서 주는 샘플이 혼란을 주니...흐...
/**
* The MIME type of {@link #CONTENT_URI} providing a directory of notes.
*/
public static final String CONTENT_TYPE = "vnd.android.cursor.dir/vnd.google.note";
/**
* The MIME type of a {@link #CONTENT_URI} sub-directory of a single note.
*/
public static final String CONTENT_ITEM_TYPE = "vnd.android.cursor.item/vnd.google.note";
주석에는 이것이 MIME타입이라고 되어있기는 한데...제가 아는 MIME형식들이랑은 많이 다른거 같고...
잘 모르겠네요. 한참 웹과 포럼들을 돌아다녀도 모르겠고요....
저 MIME타입들이 어떤 규칙으로 정해진건지..또는 어디서 규칙이나 표준에 대한 정보를 찾아볼 수 있을까요?
설명이 어려운 것이면 레퍼런스될만한 사이트를 알려주세요.
읽어주셔서 감사합니다.
P.S
NotePad 예를 보면서 공부중인데요.
NotePad.java가 양쪽에 있어서 이거 무슨 이유로 양쪽에 있을까 한참 헤맸는데...
하나는 필요없는 거인거같네요...빼도 잘 동작하는 것이...음...제조사에서 주는 샘플이 혼란을 주니...흐...
If you are handling a new data type, you must define a new MIME type to return in your implementation of
. The type depends in part on whether or not theContentProvider.getType()
content:
URI submitted togetType()
limits the request to a specific record. There's one form of the MIME type for a single record and another for multiple records. Use theUri
methods to help determine what is being requested. Here is the general format for each type:For a single record:
vnd.android.cursor.item/vnd.yourcompanyname.contenttype
For example, a request for train record 122, like this URI,
content://com.example.transportationprovider/trains/122
might return this MIME type:
vnd.android.cursor.item/vnd.example.rail
For multiple records:
vnd.android.cursor.dir/vnd.yourcompanyname.contenttype
For example, a request for all train records, like the following URI,
content://com.example.transportationprovider/trains
might return this MIME type:
vnd.android.cursor.dir/vnd.example.rail