# CloudMediaProviderContract.MediaCollectionInfo

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)

# MediaCollectionInfo

*** ** * ** ***

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

```
class MediaCollectionInfo
```

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

Constants related to a media collection

## Summary

|                                                                                                                                                                                                                                                                                 Constants                                                                                                                                                                                                                                                                                 ||
|----------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| static[String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html) | [ACCOUNT_CONFIGURATION_INTENT](https://developer.android.com/reference/kotlin/android/provider/CloudMediaProviderContract.MediaCollectionInfo#ACCOUNT_CONFIGURATION_INTENT:kotlin.String) [Intent](https://developer.android.com/reference/kotlin/android/content/Intent.html#)Intent to launch an[Activity](https://developer.android.com/reference/kotlin/android/app/Activity.html#)to allow users configure their media collection account information like the account name. |
| static[String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html) | [ACCOUNT_NAME](https://developer.android.com/reference/kotlin/android/provider/CloudMediaProviderContract.MediaCollectionInfo#ACCOUNT_NAME:kotlin.String) Name of the account that owns the media collection.                                                                                                                                                                                                                                                                     |
| static[String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html) | [LAST_MEDIA_SYNC_GENERATION](https://developer.android.com/reference/kotlin/android/provider/CloudMediaProviderContract.MediaCollectionInfo#LAST_MEDIA_SYNC_GENERATION:kotlin.String) Last[CloudMediaProviderContract.MediaColumns.SYNC_GENERATION](https://developer.android.com/reference/kotlin/android/provider/CloudMediaProviderContract.MediaColumns#SYNC_GENERATION:kotlin.String)in the media collection including deleted media items.                                  |
| static[String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html) | [MEDIA_COLLECTION_ID](https://developer.android.com/reference/kotlin/android/provider/CloudMediaProviderContract.MediaCollectionInfo#MEDIA_COLLECTION_ID:kotlin.String) Media collection identifier                                                                                                                                                                                                                                                                               |

## Constants

### ACCOUNT_CONFIGURATION_INTENT

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 ACCOUNT_CONFIGURATION_INTENT: String
```

[Intent](https://developer.android.com/reference/kotlin/android/content/Intent.html#)Intent to launch an[Activity](https://developer.android.com/reference/kotlin/android/app/Activity.html#)to allow users configure their media collection account information like the account name.

Type: PARCELABLE  

    Value: "account_configuration_intent"

**See Also**

- [android.provider.CloudMediaProvider#onGetMediaCollectionInfo](https://developer.android.com/reference/kotlin/android/provider/CloudMediaProvider#onGetMediaCollectionInfo(android.os.Bundle))  

### ACCOUNT_NAME

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 ACCOUNT_NAME: String
```

Name of the account that owns the media collection.

Type: STRING  

    Value: "account_name"

**See Also**

- [android.provider.CloudMediaProvider#onGetMediaCollectionInfo](https://developer.android.com/reference/kotlin/android/provider/CloudMediaProvider#onGetMediaCollectionInfo(android.os.Bundle))  

### LAST_MEDIA_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 LAST_MEDIA_SYNC_GENERATION: String
```

Last[CloudMediaProviderContract.MediaColumns.SYNC_GENERATION](https://developer.android.com/reference/kotlin/android/provider/CloudMediaProviderContract.MediaColumns#SYNC_GENERATION:kotlin.String)in the media collection including deleted media items.

Providers should associate a monotonically increasing sync generation to each media item change (insertion/deletion/update). This is useful for the OS to quickly identify exactly which media items have changed since a previous point in time.

Type: LONG  

    Value: "last_media_sync_generation"

**See Also**

- [android.provider.CloudMediaProviderContract#EXTRA_SYNC_GENERATION](https://developer.android.com/reference/kotlin/android/provider/CloudMediaProviderContract#EXTRA_SYNC_GENERATION:kotlin.String)
- [android.provider.CloudMediaProvider#onGetMediaCollectionInfo](https://developer.android.com/reference/kotlin/android/provider/CloudMediaProvider#onGetMediaCollectionInfo(android.os.Bundle))
- [android.provider.CloudMediaProviderContract.MediaColumns#SYNC_GENERATION](https://developer.android.com/reference/kotlin/android/provider/CloudMediaProviderContract.MediaColumns#SYNC_GENERATION:kotlin.String)  

### MEDIA_COLLECTION_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 MEDIA_COLLECTION_ID: String
```

Media collection identifier

The only requirement on the collection ID is uniqueness on a device.

This value will not be interpreted by the OS, however it will be used to check the validity of cached data and URI grants to client apps. Anytime the media or album ids get re-indexed, a new collection with a new and unique id should be created so that the OS can clear its cache and more importantly, revoke any URI grants to apps.

Apps are recommended to generate unique collection ids with,[UUID.randomUUID](https://developer.android.com/reference/kotlin/java/util/UUID.html#randomUUID()). This is preferred to using a simple monotonic sequence because the provider data could get cleared and it might have to re-index media items on the device without any history of its last ID. With random UUIDs, if data gets cleared, a new one can easily be generated safely.

Type: STRING  

    Value: "media_collection_id"

**See Also**

- [android.provider.CloudMediaProvider#onGetMediaCollectionInfo](https://developer.android.com/reference/kotlin/android/provider/CloudMediaProvider#onGetMediaCollectionInfo(android.os.Bundle))