MediaColumns


class MediaColumns
kotlin.Any
   ↳ android.provider.CloudMediaProviderContract.MediaColumns

Constants related to a media item, including Cursor column names

Summary

Constants
static String

Timestamp when a media item was capture, in milliseconds since January 1, 1970 00:00:00.

static String

Duration of a video file in ms.

static String

This column contains the height of the image or video.

static String

Unique ID of a media item.

static String

Whether the item has been favourited in the media collection.

static String

MediaStore URI of a media file if the file is available locally on the device.

static String

Concrete MIME type of a media file.

static String

This column contains the orientation, if available.

static String

Size of a media file, in bytes.

static String

Mime-type extension representing special format for a media item.

static Int

Constant for the STANDARD_MIME_TYPE_EXTENSION column indicating that the media item is an Animated Webp.

static Int

Constant for the STANDARD_MIME_TYPE_EXTENSION column indicating that the media item is a GIF.

static Int

Constant for the STANDARD_MIME_TYPE_EXTENSION column indicating that the media item is a Motion Photo.

static Int

Constant for the STANDARD_MIME_TYPE_EXTENSION column indicating that the media item doesn't have any special format associated with it.

static String

Non-negative number associated with a media item indicating what generation or batch the media item was synced into the media collection.

static String

This column contains the width of the image or video.

Constants

DATE_TAKEN_MILLIS

static val DATE_TAKEN_MILLIS: String

Timestamp when a media item was capture, in milliseconds since January 1, 1970 00:00:00.0 UTC.

Implementations should extract this data from the metadata embedded in the media file. If this information is not available, a reasonable heuristic can be used, e.g. the time the media file was added to the media collection.

Type: LONG

Value: "date_taken_millis"

DURATION_MILLIS

static val DURATION_MILLIS: String

Duration of a video file in ms. If the file is an image for which duration is not applicable, this field can be left empty or set to zero.

Type: LONG

Value: "duration_millis"

HEIGHT

static val HEIGHT: String

This column contains the height of the image or video.

Value: "height"

ID

static val ID: String

Unique ID of a media item. This ID is both provided by and interpreted by a CloudMediaProvider, and should be treated as an opaque value by client applications.

Each media item must have a unique ID within a provider.

A provider must always return stable IDs, since they will be used to issue long-term URI permission grants when an application interacts with MediaStore.ACTION_PICK_IMAGES.

Type: STRING

Value: "id"

IS_FAVORITE

static val IS_FAVORITE: String

Whether the item has been favourited in the media collection. If non-zero, this media item will appear in the favourites category in the Photo Picker.

Type: INTEGER

Value: "is_favorite"

MEDIA_STORE_URI

static val MEDIA_STORE_URI: String

MediaStore URI of a media file if the file is available locally on the device.

If it's a cloud-only media file, this field should not be set. Any of the following URIs can be used: MediaStore.Files, MediaStore.Images or MediaStore.Video e.g. content://media/file/45.

Implementations don't need to handle the MediaStore URI becoming invalid after the local item has been deleted or modified. If the URI becomes invalid or the local and cloud file content diverges, the OS will treat the cloud media item as a cloud-only item.

Type: STRING

Value: "media_store_uri"

MIME_TYPE

static val MIME_TYPE: String

Concrete MIME type of a media file. For example, "image/png" or "video/mp4".

Type: STRING

Value: "mime_type"

ORIENTATION

static val ORIENTATION: String

This column contains the orientation, if available.

For consistency the indexed value is expressed in degrees, such as 0, 90, 180, or 270.

Value: "orientation"

SIZE_BYTES

static val SIZE_BYTES: String

Size of a media file, in bytes.

Type: LONG

Value: "size_bytes"

STANDARD_MIME_TYPE_EXTENSION

static val STANDARD_MIME_TYPE_EXTENSION: String

Mime-type extension representing special format for a media item. Photo Picker requires special format tagging for media items. This is essential as media items can have various formats like Motion Photos, GIFs etc, which are not identifiable by MIME_TYPE.

Type: INTEGER

Value: "standard_mime_type_extension"

STANDARD_MIME_TYPE_EXTENSION_ANIMATED_WEBP

static val STANDARD_MIME_TYPE_EXTENSION_ANIMATED_WEBP: Int

Constant for the STANDARD_MIME_TYPE_EXTENSION column indicating that the media item is an Animated Webp.

Value: 3

STANDARD_MIME_TYPE_EXTENSION_GIF

static val STANDARD_MIME_TYPE_EXTENSION_GIF: Int

Constant for the STANDARD_MIME_TYPE_EXTENSION column indicating that the media item is a GIF.

Value: 1

STANDARD_MIME_TYPE_EXTENSION_MOTION_PHOTO

static val STANDARD_MIME_TYPE_EXTENSION_MOTION_PHOTO: Int

Constant for the STANDARD_MIME_TYPE_EXTENSION column indicating that the media item is a Motion Photo.

Value: 2

STANDARD_MIME_TYPE_EXTENSION_NONE

static val STANDARD_MIME_TYPE_EXTENSION_NONE: Int

Constant for the STANDARD_MIME_TYPE_EXTENSION column indicating that the media item doesn't have any special format associated with it.

Value: 0

SYNC_GENERATION

static val SYNC_GENERATION: String

Non-negative number associated with a media item indicating what generation or batch the media item was synced into the media collection.

Providers should associate a monotonically increasing sync generation number to each media item which is expected to increase for each atomic modification on the media item. This is useful for the OS to quickly identify that a media item has changed since a previous point in time. Note that this does not need to be unique across all media items, i.e. multiple media items can have the same SYNC_GENERATION value. However, the modification of a media item should increase the MediaCollectionInfo.LAST_MEDIA_SYNC_GENERATION.

Type: LONG

Value: "sync_generation"

WIDTH

static val WIDTH: String

This column contains the width of the image or video.

Value: "width"