Save the date! Android Dev Summit is coming to Sunnyvale, CA on Oct 23-24, 2019.

MediaStore.MediaColumns

public static interface MediaStore.MediaColumns
implements BaseColumns

android.provider.MediaStore.MediaColumns


Common media metadata columns.

Summary

Constants

String DATA

This constant was deprecated in API level Q. Apps may not have filesystem permissions to directly access this path. Instead of trying to open this path directly, apps should use ContentResolver#openFileDescriptor(Uri, String) to gain access. This value will always be NULL for apps targeting Build.VERSION_CODES.Q or higher.

String DATE_ADDED

The time the media item was first added.

String DATE_EXPIRES

The time the media item should be considered expired.

String DATE_MODIFIED

The time the media item was last modified.

String DISPLAY_NAME

The display name of the media item.

String DOCUMENT_ID

The "document ID" GUID as defined by the XMP Media Management standard, extracted from any XMP metadata contained within this media item.

String HEIGHT

The height of the media item, in pixels.

String INSTANCE_ID

The "instance ID" GUID as defined by the XMP Media Management standard, extracted from any XMP metadata contained within this media item.

String IS_PENDING

Flag indicating if a media item is pending, and still being inserted by its owner.

String MIME_TYPE

The MIME type of the media item.

String ORIGINAL_DOCUMENT_ID

The "original document ID" GUID as defined by the XMP Media Management standard, extracted from any XMP metadata contained within this media item.

String OWNER_PACKAGE_NAME

Package name that contributed this media.

String PRIMARY_DIRECTORY

The primary directory name this media exists under.

String SECONDARY_DIRECTORY

The secondary directory name this media exists under.

String SIZE

The size of the media item.

String TITLE

The title of the media item.

String WIDTH

The width of the media item, in pixels.

Inherited constants

Constants

DATA

Added in API level 1
Deprecated in API level Q
public static final String DATA

This constant was deprecated in API level Q.
Apps may not have filesystem permissions to directly access this path. Instead of trying to open this path directly, apps should use ContentResolver#openFileDescriptor(Uri, String) to gain access. This value will always be NULL for apps targeting Build.VERSION_CODES.Q or higher.

Path to the media item on disk.

Note that apps may not have filesystem permissions to directly access this path. Instead of trying to open this path directly, apps should use ContentResolver#openFileDescriptor(Uri, String) to gain access.

Constant Value: "_data"

DATE_ADDED

Added in API level 1
public static final String DATE_ADDED

The time the media item was first added.

Constant Value: "date_added"

DATE_EXPIRES

public static final String DATE_EXPIRES

The time the media item should be considered expired. Typically only meaningful in the context of IS_PENDING.

Constant Value: "date_expires"

DATE_MODIFIED

Added in API level 1
public static final String DATE_MODIFIED

The time the media item was last modified.

Constant Value: "date_modified"

DISPLAY_NAME

Added in API level 1
public static final String DISPLAY_NAME

The display name of the media item.

Constant Value: "_display_name"

DOCUMENT_ID

public static final String DOCUMENT_ID

The "document ID" GUID as defined by the XMP Media Management standard, extracted from any XMP metadata contained within this media item. The value is null when no metadata was found.

Each "document ID" is created once for each new resource. Different renditions of that resource are expected to have different IDs.

Constant Value: "document_id"

HEIGHT

Added in API level 16
public static final String HEIGHT

The height of the media item, in pixels.

Constant Value: "height"

INSTANCE_ID

public static final String INSTANCE_ID

The "instance ID" GUID as defined by the XMP Media Management standard, extracted from any XMP metadata contained within this media item. The value is null when no metadata was found.

This "instance ID" changes with each save operation of a specific "document ID".

Constant Value: "instance_id"

IS_PENDING

public static final String IS_PENDING

Flag indicating if a media item is pending, and still being inserted by its owner.

Constant Value: "is_pending"

MIME_TYPE

Added in API level 1
public static final String MIME_TYPE

The MIME type of the media item.

This is typically defined based on the file extension of the media item. However, it may be the value of the format attribute defined by the Dublin Core Media Initiative standard, extracted from any XMP metadata contained within this media item.

Note: the format attribute may be ignored if the top-level MIME type disagrees with the file extension. For example, it's reasonable for an image/jpeg file to declare a format of image/vnd.google.panorama360+jpg, but declaring a format of audio/ogg would be ignored.

This is a read-only column that is automatically computed.

Constant Value: "mime_type"

ORIGINAL_DOCUMENT_ID

public static final String ORIGINAL_DOCUMENT_ID

The "original document ID" GUID as defined by the XMP Media Management standard, extracted from any XMP metadata contained within this media item.

This "original document ID" links a resource to its original source. For example, when you save a PSD document as a JPEG, then convert the JPEG to GIF format, the "original document ID" of both the JPEG and GIF files is the "document ID" of the original PSD file.

Constant Value: "original_document_id"

OWNER_PACKAGE_NAME

public static final String OWNER_PACKAGE_NAME

Package name that contributed this media. The value may be NULL if ownership cannot be reliably determined.

Constant Value: "owner_package_name"

PRIMARY_DIRECTORY

public static final String PRIMARY_DIRECTORY

The primary directory name this media exists under. The value may be NULL if the media doesn't have a primary directory name.

Constant Value: "primary_directory"

SECONDARY_DIRECTORY

public static final String SECONDARY_DIRECTORY

The secondary directory name this media exists under. The value may be NULL if the media doesn't have a secondary directory name.

Constant Value: "secondary_directory"

SIZE

Added in API level 1
public static final String SIZE

The size of the media item.
Value is a non-negative number of bytes.

Constant Value: "_size"

TITLE

Added in API level 1
public static final String TITLE

The title of the media item.

Constant Value: "title"

WIDTH

Added in API level 16
public static final String WIDTH

The width of the media item, in pixels.

Constant Value: "width"