Hallo Johannes,

> Unfortunately, I can't make a lot out of the RFC 2046
> specification (http://www.ietf.org/rfc/rfc2046.txt).

a MIME type is basically a string in the format <top-level-type>/
<subtype><options> (all 7bit US-ASCII). Typical values for <top-evel-
type> are "text", "image", "video", "audio" or "application" (a full
list is given in section 3 of RFC 2046). <subtype> further describes
the format of the content. For example if the payload of your NDEF
record is some plain text in US-ASCII you would use the MIME type
"text/plain". If the payload was an image in JPEG format the MIME type
would be "image/jpeg". <options> specifies additional options for the
MIME type. For example the "text/plain" MIME type could also use
ISO-8859-1 instead of US-ASCII as character encoding by appending ";
charset=iso-8859-1".

The Wikipedia article
  http://en.wikipedia.org/wiki/Internet_media_type
gives a introduction to registered MIME types and also explains how
you would define your own application specific non-standard MIME type.

> So, how do I correctly parse a MIME type string into said byte[]
> array?

The MIME type specifier itself is 7bit US-ASCII encoded. Sou you would
use something like this:
byte[] mimeType = "text/plain".getBytes("US-ASCII");

br,
Michael

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to