Programming/Android Java

Android Intent MIME Type

개Foot/Dog발?! 2014. 8. 10. 16:24

URL : http://sailerya.tistory.com/28


안드로이드에서도 표준 마임타입을 따른다.

http://tools.ietf.org/html/rfc2046

 

마임타입은 타입과 서브타입으로 나눈다.

 

text/html

text/css

text/xml

text/vnd.curl

application/pdf

application/rtf

application/vnd.ms-wxcel

 

인터넷 할당 번호 관리기관(IANA)웹사이트에 등록돼있는 타입과 서브타입들은

http://www.iana.org/assignments/media-types/

에 있다.

 

최상위 타입은

application

audio

example

image

message

model

multipart

text

video

 등이있으며, 이 최상위 타입들은 각각 서브타입이 있다.

공급업체가 데이터 형식을 독점하고 있는경우 서브타입 이름이 vnd로 시작한다.( ms의 excel은 vnd.ms-excel)

등록할 필요없는 비표준 서브타입은 x-로 시작한다.이는 공급업체간의 합의에 의해 정의된 비공식 값들이다.

 

 

안드로이드에서의 마임타입 주의사항:

-타입과 서브타입은 고유한 것이어야 한다.

-타입과 서브타입이 비표준일 경우에는 반드시 vnd를 붙여야 한다.

-마임타입은 일반적으로 개발자의 필요에 맞게 이름공간으로 사용된다.

(최상위 마임타입) : vnd.android.cursor.dir

(단일항목 최상위 마임 타입) : vnd.android.cursor.item

 

 

메모 디렉토리를 표시하는 마임타입 등록 예

<intent-filter>

 <action android:name="android.intent.action.VIEW"/>

 <data android:mimeType="vnd.android.cursor.dir/vnd.google.note"/>

</intent-filter>

 

한개의 메모 표시마임타입 등록 예

<intent-filter>

 <action android:name="android.intent.action.VIEW"/>

 <data android:mimeType="vnd.android.cursor.item/vnd.google.note"/>

</intent-filter>