MediaStore.MediaColumns

public static interface MediaStore.MediaColumns
implements BaseColumns

android.provider.MediaStore.MediaColumns


Common media metadata columns.

Summary

Constants

String BUCKET_DISPLAY_NAME

The primary bucket display name of this media item.

String BUCKET_ID

The primary bucket ID of this media item.

String DATA

This constant was deprecated in API level 29. 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.

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 DATE_TAKEN

The time the media item was taken.

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 DURATION

The duration of the 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 ORIENTATION

The orientation for the media item, expressed in degrees.

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 RELATIVE_PATH

Relative path of this media item within the storage device where it is persisted.

String SIZE

The size of the media item.

String TITLE

The title of the media item.

String VOLUME_NAME

Volume name of the specific storage device where this media item is persisted.

String WIDTH

The width of the media item, in pixels.

Inherited constants

Constants

BUCKET_DISPLAY_NAME

Added in API level 29
public static final String BUCKET_DISPLAY_NAME

The primary bucket display name of this media item. This can be useful to present the user a first-level clustering of related media items. This is a read-only column that is automatically computed.

Constant Value: "bucket_display_name"

BUCKET_ID

Added in API level 29
public static final String BUCKET_ID

The primary bucket ID of this media item. This can be useful to present the user a first-level clustering of related media items. This is a read-only column that is automatically computed.

Constant Value: "bucket_id"

DATA

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

This constant was deprecated in API level 29.
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.

Absolute filesystem 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

Added in API level 29
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"

DATE_TAKEN

Added in API level 29
public static final String DATE_TAKEN

The time the media item was taken.
Value is a non-negative timestamp measured as the number of milliseconds since 1970-01-01T00:00:00Z.

Constant Value: "datetaken"

DISPLAY_NAME

Added in API level 1
public static final String DISPLAY_NAME

The display name of the media item.

For example, an item stored at /storage/0000-0000/DCIM/Vacation/IMG1024.JPG would have a display name of IMG1024.JPG.

Constant Value: "_display_name"

DOCUMENT_ID

Added in API level 29
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"

DURATION

Added in API level 29
public static final String DURATION

The duration of the media item.
Value is a non-negative duration in milliseconds.

Constant Value: "duration"

HEIGHT

Added in API level 16
public static final String HEIGHT

The height of the media item, in pixels.

Constant Value: "height"

INSTANCE_ID

Added in API level 29
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

Added in API level 29
public static final String IS_PENDING

Flag indicating if a media item is pending, and still being inserted by its owner. While this flag is set, only the owner of the item can open the underlying file; requests from other apps will be rejected.

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"

ORIENTATION

Added in API level 29
public static final String ORIENTATION

The orientation for the media item, expressed in degrees. For example, 0, 90, 180, or 270 degrees.

Constant Value: "orientation"

ORIGINAL_DOCUMENT_ID

Added in API level 29
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

Added in API level 29
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"

RELATIVE_PATH

Added in API level 29
public static final String RELATIVE_PATH

Relative path of this media item within the storage device where it is persisted. For example, an item stored at /storage/0000-0000/DCIM/Vacation/IMG1024.JPG would have a path of DCIM/Vacation/.

This value should only be used for organizational purposes, and you should not attempt to construct or access a raw filesystem path using this value. If you need to open a media item, use an API like ContentResolver#openFileDescriptor(Uri, String).

When this value is set to NULL during an ContentResolver#insert operation, the newly created item will be placed in a relevant default location based on the type of media being inserted. For example, a image/jpeg item will be placed under Environment#DIRECTORY_PICTURES.

You can modify this column during an ContentResolver#update call, which will move the underlying file on disk.

In both cases above, content must be placed under a top-level directory that is relevant to the media type. For example, attempting to place a audio/mpeg file under Environment#DIRECTORY_PICTURES will be rejected.

Constant Value: "relative_path"

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"

VOLUME_NAME

Added in API level 29
public static final String VOLUME_NAME

Volume name of the specific storage device where this media item is persisted. The value is typically one of the volume names returned from MediaStore#getExternalVolumeNames(Context).

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

Constant Value: "volume_name"

WIDTH

Added in API level 16
public static final String WIDTH

The width of the media item, in pixels.

Constant Value: "width"