CloudMediaProviderContract.MediaColumns


public static final class CloudMediaProviderContract.MediaColumns
extends Object

java.lang.Object
   ↳ android.provider.CloudMediaProviderContract.MediaColumns


Constants related to a media item, including Cursor column names

Summary

Constants

String DATE_TAKEN_MILLIS

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

String DURATION_MILLIS

Duration of a video file in ms.

String HEIGHT

This column contains the height of the image or video.

String ID

Unique ID of a media item.

String IS_FAVORITE

Whether the item has been favourited in the media collection.

String MEDIA_STORE_URI

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

String MIME_TYPE

Concrete MIME type of a media file.

String ORIENTATION

This column contains the orientation, if available.

String SIZE_BYTES

Size of a media file, in bytes.

String STANDARD_MIME_TYPE_EXTENSION

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

int STANDARD_MIME_TYPE_EXTENSION_ANIMATED_WEBP

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

int STANDARD_MIME_TYPE_EXTENSION_GIF

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

int STANDARD_MIME_TYPE_EXTENSION_MOTION_PHOTO

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

int STANDARD_MIME_TYPE_EXTENSION_NONE

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

String SYNC_GENERATION

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

String WIDTH

This column contains the width of the image or video.

Inherited methods

Constants

DATE_TAKEN_MILLIS

Added in API level 33
Also in R Extensions 3
public static final String DATE_TAKEN_MILLIS

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

Constant Value: "date_taken_millis"

DURATION_MILLIS

Added in API level 33
Also in R Extensions 3
public static final String DURATION_MILLIS

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

Constant Value: "duration_millis"

HEIGHT

Added in API level 34
Also in R Extensions 5
public static final String HEIGHT

This column contains the height of the image or video.

Constant Value: "height"

ID

Added in API level 33
Also in R Extensions 3
public static final String ID

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

Constant Value: "id"

IS_FAVORITE

Added in API level 33
Also in R Extensions 3
public static final String IS_FAVORITE

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

Constant Value: "is_favorite"

MEDIA_STORE_URI

Added in API level 33
Also in R Extensions 3
public static final String MEDIA_STORE_URI

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

Constant Value: "media_store_uri"

MIME_TYPE

Added in API level 33
Also in R Extensions 3
public static final String MIME_TYPE

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

Type: STRING

Constant Value: "mime_type"

ORIENTATION

Added in API level 34
Also in R Extensions 5
public static final String ORIENTATION

This column contains the orientation, if available.

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

Constant Value: "orientation"

SIZE_BYTES

Added in API level 33
Also in R Extensions 3
public static final String SIZE_BYTES

Size of a media file, in bytes.

Type: LONG

Constant Value: "size_bytes"

STANDARD_MIME_TYPE_EXTENSION

Added in API level 33
Also in R Extensions 3
public static final String STANDARD_MIME_TYPE_EXTENSION

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

Constant Value: "standard_mime_type_extension"

STANDARD_MIME_TYPE_EXTENSION_ANIMATED_WEBP

Added in API level 33
Also in R Extensions 3
public static final int STANDARD_MIME_TYPE_EXTENSION_ANIMATED_WEBP

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

Constant Value: 3 (0x00000003)

STANDARD_MIME_TYPE_EXTENSION_GIF

Added in API level 33
Also in R Extensions 3
public static final int STANDARD_MIME_TYPE_EXTENSION_GIF

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

Constant Value: 1 (0x00000001)

STANDARD_MIME_TYPE_EXTENSION_MOTION_PHOTO

Added in API level 33
Also in R Extensions 3
public static final int STANDARD_MIME_TYPE_EXTENSION_MOTION_PHOTO

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

Constant Value: 2 (0x00000002)

STANDARD_MIME_TYPE_EXTENSION_NONE

Added in API level 33
Also in R Extensions 3
public static final int STANDARD_MIME_TYPE_EXTENSION_NONE

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

Constant Value: 0 (0x00000000)

SYNC_GENERATION

Added in API level 33
Also in R Extensions 3
public static final String SYNC_GENERATION

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

Constant Value: "sync_generation"

WIDTH

Added in API level 34
Also in R Extensions 5
public static final String WIDTH

This column contains the width of the image or video.

Constant Value: "width"