FileDocCategorySizeDatePackage
ContentType.javaAPI DocAndroid 5.1 API10104Thu Mar 12 22:22:54 GMT 2015com.google.android.mms

ContentType

public class ContentType extends Object

Fields Summary
public static final String
MMS_MESSAGE
public static final String
MMS_GENERIC
public static final String
MULTIPART_MIXED
public static final String
MULTIPART_RELATED
public static final String
MULTIPART_ALTERNATIVE
public static final String
TEXT_PLAIN
public static final String
TEXT_HTML
public static final String
TEXT_VCALENDAR
public static final String
TEXT_VCARD
public static final String
IMAGE_UNSPECIFIED
public static final String
IMAGE_JPEG
public static final String
IMAGE_JPG
public static final String
IMAGE_GIF
public static final String
IMAGE_WBMP
public static final String
IMAGE_PNG
public static final String
IMAGE_X_MS_BMP
public static final String
AUDIO_UNSPECIFIED
public static final String
AUDIO_AAC
public static final String
AUDIO_AMR
public static final String
AUDIO_IMELODY
public static final String
AUDIO_MID
public static final String
AUDIO_MIDI
public static final String
AUDIO_MP3
public static final String
AUDIO_MPEG3
public static final String
AUDIO_MPEG
public static final String
AUDIO_MPG
public static final String
AUDIO_MP4
public static final String
AUDIO_X_MID
public static final String
AUDIO_X_MIDI
public static final String
AUDIO_X_MP3
public static final String
AUDIO_X_MPEG3
public static final String
AUDIO_X_MPEG
public static final String
AUDIO_X_MPG
public static final String
AUDIO_3GPP
public static final String
AUDIO_X_WAV
public static final String
AUDIO_OGG
public static final String
VIDEO_UNSPECIFIED
public static final String
VIDEO_3GPP
public static final String
VIDEO_3G2
public static final String
VIDEO_H263
public static final String
VIDEO_MP4
public static final String
APP_SMIL
public static final String
APP_WAP_XHTML
public static final String
APP_XHTML
public static final String
APP_DRM_CONTENT
public static final String
APP_DRM_MESSAGE
private static final ArrayList
sSupportedContentTypes
private static final ArrayList
sSupportedImageTypes
private static final ArrayList
sSupportedAudioTypes
private static final ArrayList
sSupportedVideoTypes
Constructors Summary
private ContentType()


     
        sSupportedContentTypes.add(TEXT_PLAIN);
        sSupportedContentTypes.add(TEXT_HTML);
        sSupportedContentTypes.add(TEXT_VCALENDAR);
        sSupportedContentTypes.add(TEXT_VCARD);

        sSupportedContentTypes.add(IMAGE_JPEG);
        sSupportedContentTypes.add(IMAGE_GIF);
        sSupportedContentTypes.add(IMAGE_WBMP);
        sSupportedContentTypes.add(IMAGE_PNG);
        sSupportedContentTypes.add(IMAGE_JPG);
        sSupportedContentTypes.add(IMAGE_X_MS_BMP);
        //supportedContentTypes.add(IMAGE_SVG); not yet supported.

        sSupportedContentTypes.add(AUDIO_AAC);
        sSupportedContentTypes.add(AUDIO_AMR);
        sSupportedContentTypes.add(AUDIO_IMELODY);
        sSupportedContentTypes.add(AUDIO_MID);
        sSupportedContentTypes.add(AUDIO_MIDI);
        sSupportedContentTypes.add(AUDIO_MP3);
        sSupportedContentTypes.add(AUDIO_MP4);
        sSupportedContentTypes.add(AUDIO_MPEG3);
        sSupportedContentTypes.add(AUDIO_MPEG);
        sSupportedContentTypes.add(AUDIO_MPG);
        sSupportedContentTypes.add(AUDIO_X_MID);
        sSupportedContentTypes.add(AUDIO_X_MIDI);
        sSupportedContentTypes.add(AUDIO_X_MP3);
        sSupportedContentTypes.add(AUDIO_X_MPEG3);
        sSupportedContentTypes.add(AUDIO_X_MPEG);
        sSupportedContentTypes.add(AUDIO_X_MPG);
        sSupportedContentTypes.add(AUDIO_X_WAV);
        sSupportedContentTypes.add(AUDIO_3GPP);
        sSupportedContentTypes.add(AUDIO_OGG);

        sSupportedContentTypes.add(VIDEO_3GPP);
        sSupportedContentTypes.add(VIDEO_3G2);
        sSupportedContentTypes.add(VIDEO_H263);
        sSupportedContentTypes.add(VIDEO_MP4);

        sSupportedContentTypes.add(APP_SMIL);
        sSupportedContentTypes.add(APP_WAP_XHTML);
        sSupportedContentTypes.add(APP_XHTML);

        sSupportedContentTypes.add(APP_DRM_CONTENT);
        sSupportedContentTypes.add(APP_DRM_MESSAGE);

        // add supported image types
        sSupportedImageTypes.add(IMAGE_JPEG);
        sSupportedImageTypes.add(IMAGE_GIF);
        sSupportedImageTypes.add(IMAGE_WBMP);
        sSupportedImageTypes.add(IMAGE_PNG);
        sSupportedImageTypes.add(IMAGE_JPG);
        sSupportedImageTypes.add(IMAGE_X_MS_BMP);

        // add supported audio types
        sSupportedAudioTypes.add(AUDIO_AAC);
        sSupportedAudioTypes.add(AUDIO_AMR);
        sSupportedAudioTypes.add(AUDIO_IMELODY);
        sSupportedAudioTypes.add(AUDIO_MID);
        sSupportedAudioTypes.add(AUDIO_MIDI);
        sSupportedAudioTypes.add(AUDIO_MP3);
        sSupportedAudioTypes.add(AUDIO_MPEG3);
        sSupportedAudioTypes.add(AUDIO_MPEG);
        sSupportedAudioTypes.add(AUDIO_MPG);
        sSupportedAudioTypes.add(AUDIO_MP4);
        sSupportedAudioTypes.add(AUDIO_X_MID);
        sSupportedAudioTypes.add(AUDIO_X_MIDI);
        sSupportedAudioTypes.add(AUDIO_X_MP3);
        sSupportedAudioTypes.add(AUDIO_X_MPEG3);
        sSupportedAudioTypes.add(AUDIO_X_MPEG);
        sSupportedAudioTypes.add(AUDIO_X_MPG);
        sSupportedAudioTypes.add(AUDIO_X_WAV);
        sSupportedAudioTypes.add(AUDIO_3GPP);
        sSupportedAudioTypes.add(AUDIO_OGG);

        // add supported video types
        sSupportedVideoTypes.add(VIDEO_3GPP);
        sSupportedVideoTypes.add(VIDEO_3G2);
        sSupportedVideoTypes.add(VIDEO_H263);
        sSupportedVideoTypes.add(VIDEO_MP4);
    
    
Methods Summary
public static java.util.ArrayListgetAudioTypes()

        return (ArrayList<String>) sSupportedAudioTypes.clone();
    
public static java.util.ArrayListgetImageTypes()

        return (ArrayList<String>) sSupportedImageTypes.clone();
    
public static java.util.ArrayListgetSupportedTypes()

        return (ArrayList<String>) sSupportedContentTypes.clone();
    
public static java.util.ArrayListgetVideoTypes()

        return (ArrayList<String>) sSupportedVideoTypes.clone();
    
public static booleanisAudioType(java.lang.String contentType)

        return (null != contentType) && contentType.startsWith("audio/");
    
public static booleanisDrmType(java.lang.String contentType)

        return (null != contentType)
                && (contentType.equals(APP_DRM_CONTENT)
                        || contentType.equals(APP_DRM_MESSAGE));
    
public static booleanisImageType(java.lang.String contentType)

        return (null != contentType) && contentType.startsWith("image/");
    
public static booleanisSupportedAudioType(java.lang.String contentType)

        return isAudioType(contentType) && isSupportedType(contentType);
    
public static booleanisSupportedImageType(java.lang.String contentType)

        return isImageType(contentType) && isSupportedType(contentType);
    
public static booleanisSupportedType(java.lang.String contentType)

        return (null != contentType) && sSupportedContentTypes.contains(contentType);
    
public static booleanisSupportedVideoType(java.lang.String contentType)

        return isVideoType(contentType) && isSupportedType(contentType);
    
public static booleanisTextType(java.lang.String contentType)

        return (null != contentType) && contentType.startsWith("text/");
    
public static booleanisUnspecified(java.lang.String contentType)

        return (null != contentType) && contentType.endsWith("*");
    
public static booleanisVideoType(java.lang.String contentType)

        return (null != contentType) && contentType.startsWith("video/");