# CloudMediaProviderContract.MediaColumns

Added in[API level 33](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  
Also in[R Extensions 3](https://developer.android.com/sdkExtensions)

# MediaColumns

*** ** * ** ***

Kotlin\|[Java](https://developer.android.com/reference/android/provider/CloudMediaProviderContract.MediaColumns "View this page in Java")  

```
class MediaColumns
```

|---|----------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [kotlin.Any](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/index.html)                                                                                       ||
| ↳ | [android.provider.CloudMediaProviderContract.MediaColumns](https://developer.android.com/reference/kotlin/android/provider/CloudMediaProviderContract.MediaColumns#) |

Constants related to a media item, including[Cursor](https://developer.android.com/reference/kotlin/android/database/Cursor.html#)column names

## Summary

|                                                                                                                                                                                                                                                                                   Constants                                                                                                                                                                                                                                                                                   ||
|----------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| static[String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html) | [DATE_TAKEN_MILLIS](https://developer.android.com/reference/kotlin/android/provider/CloudMediaProviderContract.MediaColumns#DATE_TAKEN_MILLIS:kotlin.String) Timestamp when a media item was capture, in milliseconds since January 1, 1970 00:00:00.                                                                                                                                                                                                                                 |
| static[String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html) | [DURATION_MILLIS](https://developer.android.com/reference/kotlin/android/provider/CloudMediaProviderContract.MediaColumns#DURATION_MILLIS:kotlin.String) Duration of a video file in ms.                                                                                                                                                                                                                                                                                              |
| static[String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html) | [HEIGHT](https://developer.android.com/reference/kotlin/android/provider/CloudMediaProviderContract.MediaColumns#HEIGHT:kotlin.String) This column contains the height of the image or video.                                                                                                                                                                                                                                                                                         |
| static[String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html) | [ID](https://developer.android.com/reference/kotlin/android/provider/CloudMediaProviderContract.MediaColumns#ID:kotlin.String) Unique ID of a media item.                                                                                                                                                                                                                                                                                                                             |
| static[String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html) | [IS_FAVORITE](https://developer.android.com/reference/kotlin/android/provider/CloudMediaProviderContract.MediaColumns#IS_FAVORITE:kotlin.String) Whether the item has been favourited in the media collection.                                                                                                                                                                                                                                                                        |
| static[String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html) | [MEDIA_STORE_URI](https://developer.android.com/reference/kotlin/android/provider/CloudMediaProviderContract.MediaColumns#MEDIA_STORE_URI:kotlin.String) [MediaStore](https://developer.android.com/reference/kotlin/android/provider/MediaStore)URI of a media file if the file is available locally on the device.                                                                                                                                                                  |
| static[String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html) | [MIME_TYPE](https://developer.android.com/reference/kotlin/android/provider/CloudMediaProviderContract.MediaColumns#MIME_TYPE:kotlin.String) Concrete MIME type of a media file.                                                                                                                                                                                                                                                                                                      |
| static[String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html) | [ORIENTATION](https://developer.android.com/reference/kotlin/android/provider/CloudMediaProviderContract.MediaColumns#ORIENTATION:kotlin.String) This column contains the orientation, if available.                                                                                                                                                                                                                                                                                  |
| static[String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html) | [SIZE_BYTES](https://developer.android.com/reference/kotlin/android/provider/CloudMediaProviderContract.MediaColumns#SIZE_BYTES:kotlin.String) Size of a media file, in bytes.                                                                                                                                                                                                                                                                                                        |
| static[String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html) | [STANDARD_MIME_TYPE_EXTENSION](https://developer.android.com/reference/kotlin/android/provider/CloudMediaProviderContract.MediaColumns#STANDARD_MIME_TYPE_EXTENSION:kotlin.String) Mime-type extension representing special format for a media item.                                                                                                                                                                                                                                  |
| static[Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)       | [STANDARD_MIME_TYPE_EXTENSION_ANIMATED_WEBP](https://developer.android.com/reference/kotlin/android/provider/CloudMediaProviderContract.MediaColumns#STANDARD_MIME_TYPE_EXTENSION_ANIMATED_WEBP:kotlin.Int) Constant for the[STANDARD_MIME_TYPE_EXTENSION](https://developer.android.com/reference/kotlin/android/provider/CloudMediaProviderContract.MediaColumns#STANDARD_MIME_TYPE_EXTENSION:kotlin.String)column indicating that the media item is an Animated Webp.              |
| static[Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)       | [STANDARD_MIME_TYPE_EXTENSION_GIF](https://developer.android.com/reference/kotlin/android/provider/CloudMediaProviderContract.MediaColumns#STANDARD_MIME_TYPE_EXTENSION_GIF:kotlin.Int) Constant for the[STANDARD_MIME_TYPE_EXTENSION](https://developer.android.com/reference/kotlin/android/provider/CloudMediaProviderContract.MediaColumns#STANDARD_MIME_TYPE_EXTENSION:kotlin.String)column indicating that the media item is a GIF.                                             |
| static[Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)       | [STANDARD_MIME_TYPE_EXTENSION_MOTION_PHOTO](https://developer.android.com/reference/kotlin/android/provider/CloudMediaProviderContract.MediaColumns#STANDARD_MIME_TYPE_EXTENSION_MOTION_PHOTO:kotlin.Int) Constant for the[STANDARD_MIME_TYPE_EXTENSION](https://developer.android.com/reference/kotlin/android/provider/CloudMediaProviderContract.MediaColumns#STANDARD_MIME_TYPE_EXTENSION:kotlin.String)column indicating that the media item is a Motion Photo.                  |
| static[Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)       | [STANDARD_MIME_TYPE_EXTENSION_NONE](https://developer.android.com/reference/kotlin/android/provider/CloudMediaProviderContract.MediaColumns#STANDARD_MIME_TYPE_EXTENSION_NONE:kotlin.Int) Constant for the[STANDARD_MIME_TYPE_EXTENSION](https://developer.android.com/reference/kotlin/android/provider/CloudMediaProviderContract.MediaColumns#STANDARD_MIME_TYPE_EXTENSION:kotlin.String)column indicating that the media item doesn't have any special format associated with it. |
| static[String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html) | [SYNC_GENERATION](https://developer.android.com/reference/kotlin/android/provider/CloudMediaProviderContract.MediaColumns#SYNC_GENERATION:kotlin.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](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html) | [WIDTH](https://developer.android.com/reference/kotlin/android/provider/CloudMediaProviderContract.MediaColumns#WIDTH:kotlin.String) This column contains the width of the image or video.                                                                                                                                                                                                                                                                                            |

## Constants

### DATE_TAKEN_MILLIS

Added in[API level 33](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  
Also in[R Extensions 3](https://developer.android.com/sdkExtensions)  

```
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"

**See Also**

- [android.provider.CloudMediaProviderContract.AlbumColumns#DATE_TAKEN_MILLIS](https://developer.android.com/reference/kotlin/android/provider/CloudMediaProviderContract.AlbumColumns#DATE_TAKEN_MILLIS:kotlin.String)
- [java.lang.System#currentTimeMillis()](https://developer.android.com/reference/kotlin/java/lang/System.html#currentTimeMillis())  

### DURATION_MILLIS

Added in[API level 33](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  
Also in[R Extensions 3](https://developer.android.com/sdkExtensions)  

```
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

Added in[API level 34](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  
Also in[R Extensions 5](https://developer.android.com/sdkExtensions)  

```
static val HEIGHT: String
```

This column contains the height of the image or video.  

    Value: "height"

### ID

Added in[API level 33](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  
Also in[R Extensions 3](https://developer.android.com/sdkExtensions)  

```
static val ID: String
```

Unique ID of a media item. This ID is both provided by and interpreted by a[CloudMediaProvider](https://developer.android.com/reference/kotlin/android/provider/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](https://developer.android.com/reference/kotlin/android/provider/MediaStore#ACTION_PICK_IMAGES:kotlin.String).

Type: STRING  

    Value: "id"

### IS_FAVORITE

Added in[API level 33](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  
Also in[R Extensions 3](https://developer.android.com/sdkExtensions)  

```
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

Added in[API level 33](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  
Also in[R Extensions 3](https://developer.android.com/sdkExtensions)  

```
static val MEDIA_STORE_URI: String
```

[MediaStore](https://developer.android.com/reference/kotlin/android/provider/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](https://developer.android.com/reference/kotlin/android/provider/MediaStore.Files),[MediaStore.Images](https://developer.android.com/reference/kotlin/android/provider/MediaStore.Images)or[MediaStore.Video](https://developer.android.com/reference/kotlin/android/provider/MediaStore.Video)e.g.`content://media/file/45`.

Implementations don't need to handle the[MediaStore](https://developer.android.com/reference/kotlin/android/provider/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

Added in[API level 33](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  
Also in[R Extensions 3](https://developer.android.com/sdkExtensions)  

```
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

Added in[API level 34](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  
Also in[R Extensions 5](https://developer.android.com/sdkExtensions)  

```
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

Added in[API level 33](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  
Also in[R Extensions 3](https://developer.android.com/sdkExtensions)  

```
static val SIZE_BYTES: String
```

Size of a media file, in bytes.

Type: LONG  

    Value: "size_bytes"

### STANDARD_MIME_TYPE_EXTENSION

Added in[API level 33](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  
Also in[R Extensions 3](https://developer.android.com/sdkExtensions)  

```
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](https://developer.android.com/reference/kotlin/android/provider/CloudMediaProviderContract.MediaColumns#MIME_TYPE:kotlin.String).

Type: INTEGER  

    Value: "standard_mime_type_extension"

### STANDARD_MIME_TYPE_EXTENSION_ANIMATED_WEBP

Added in[API level 33](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  
Also in[R Extensions 3](https://developer.android.com/sdkExtensions)  

```
static val STANDARD_MIME_TYPE_EXTENSION_ANIMATED_WEBP: Int
```

Constant for the[STANDARD_MIME_TYPE_EXTENSION](https://developer.android.com/reference/kotlin/android/provider/CloudMediaProviderContract.MediaColumns#STANDARD_MIME_TYPE_EXTENSION:kotlin.String)column indicating that the media item is an Animated Webp.  

    Value: 3

### STANDARD_MIME_TYPE_EXTENSION_GIF

Added in[API level 33](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  
Also in[R Extensions 3](https://developer.android.com/sdkExtensions)  

```
static val STANDARD_MIME_TYPE_EXTENSION_GIF: Int
```

Constant for the[STANDARD_MIME_TYPE_EXTENSION](https://developer.android.com/reference/kotlin/android/provider/CloudMediaProviderContract.MediaColumns#STANDARD_MIME_TYPE_EXTENSION:kotlin.String)column indicating that the media item is a GIF.  

    Value: 1

### STANDARD_MIME_TYPE_EXTENSION_MOTION_PHOTO

Added in[API level 33](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  
Also in[R Extensions 3](https://developer.android.com/sdkExtensions)  

```
static val STANDARD_MIME_TYPE_EXTENSION_MOTION_PHOTO: Int
```

Constant for the[STANDARD_MIME_TYPE_EXTENSION](https://developer.android.com/reference/kotlin/android/provider/CloudMediaProviderContract.MediaColumns#STANDARD_MIME_TYPE_EXTENSION:kotlin.String)column indicating that the media item is a Motion Photo.  

    Value: 2

### STANDARD_MIME_TYPE_EXTENSION_NONE

Added in[API level 33](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  
Also in[R Extensions 3](https://developer.android.com/sdkExtensions)  

```
static val STANDARD_MIME_TYPE_EXTENSION_NONE: Int
```

Constant for the[STANDARD_MIME_TYPE_EXTENSION](https://developer.android.com/reference/kotlin/android/provider/CloudMediaProviderContract.MediaColumns#STANDARD_MIME_TYPE_EXTENSION:kotlin.String)column indicating that the media item doesn't have any special format associated with it.  

    Value: 0

### SYNC_GENERATION

Added in[API level 33](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  
Also in[R Extensions 3](https://developer.android.com/sdkExtensions)  

```
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](https://developer.android.com/reference/kotlin/android/provider/CloudMediaProviderContract.MediaCollectionInfo#LAST_MEDIA_SYNC_GENERATION:kotlin.String).

Type: LONG  

    Value: "sync_generation"

**See Also**

- [android.provider.CloudMediaProviderContract.MediaCollectionInfo#LAST_MEDIA_SYNC_GENERATION](https://developer.android.com/reference/kotlin/android/provider/CloudMediaProviderContract.MediaCollectionInfo#LAST_MEDIA_SYNC_GENERATION:kotlin.String)  

### WIDTH

Added in[API level 34](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  
Also in[R Extensions 5](https://developer.android.com/sdkExtensions)  

```
static val WIDTH: String
```

This column contains the width of the image or video.  

    Value: "width"