Stay organized with collections
Save and categorize content based on your preferences.
class MediaCollectionInfo
Constants related to a media collection
Summary
Constants
ACCOUNT_CONFIGURATION_INTENT
static val ACCOUNT_CONFIGURATION_INTENT: String
Intent
Intent to launch an Activity
to allow users configure their media collection account information like the account name.
Type: PARCELABLE
Value: "account_configuration_intent"
ACCOUNT_NAME
static val ACCOUNT_NAME: String
Name of the account that owns the media collection.
Type: STRING
Value: "account_name"
static val LAST_MEDIA_SYNC_GENERATION: String
Last CloudMediaProviderContract.MediaColumns.SYNC_GENERATION
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"
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
. 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"
Content and code samples on this page are subject to the licenses described in the Content License. Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.
Last updated 2025-02-10 UTC.
[null,null,["Last updated 2025-02-10 UTC."],[],[],null,["# CloudMediaProviderContract.MediaCollectionInfo\n\nAdded in [API level 33](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \nAlso in [R Extensions 3](https://developer.android.com/sdkExtensions)\n\nMediaCollectionInfo\n===================\n\n*** ** * ** ***\n\nKotlin \\|[Java](/reference/android/provider/CloudMediaProviderContract.MediaCollectionInfo \"View this page in Java\") \n\n```\nclass MediaCollectionInfo\n```\n\n|---|----------------------------------------------------------------------|\n| [kotlin.Any](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/index.html) ||\n| ↳ | [android.provider.CloudMediaProviderContract.MediaCollectionInfo](#) |\n\nConstants related to a media collection\n\nSummary\n-------\n\n| Constants ||\n|-----------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| static [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html) | [ACCOUNT_CONFIGURATION_INTENT](#ACCOUNT_CONFIGURATION_INTENT:kotlin.String) [Intent](../content/Intent.html#) Intent to launch an [Activity](../app/Activity.html#) to allow users configure their media collection account information like the account name. |\n| static [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html) | [ACCOUNT_NAME](#ACCOUNT_NAME:kotlin.String) Name of the account that owns the media collection. |\n| static [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html) | [LAST_MEDIA_SYNC_GENERATION](#LAST_MEDIA_SYNC_GENERATION:kotlin.String) Last [CloudMediaProviderContract.MediaColumns.SYNC_GENERATION](/reference/kotlin/android/provider/CloudMediaProviderContract.MediaColumns#SYNC_GENERATION:kotlin.String) in the media collection including deleted media items. |\n| static [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html) | [MEDIA_COLLECTION_ID](#MEDIA_COLLECTION_ID:kotlin.String) Media collection identifier |\n\nConstants\n---------\n\n### ACCOUNT_CONFIGURATION_INTENT\n\nAdded in [API level 33](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \nAlso in [R Extensions 3](https://developer.android.com/sdkExtensions) \n\n```\nstatic val ACCOUNT_CONFIGURATION_INTENT: String\n```\n\n[Intent](../content/Intent.html#) Intent to launch an [Activity](../app/Activity.html#) to allow users configure their media collection account information like the account name.\n\nType: PARCELABLE \n\n Value: \"account_configuration_intent\"\n\n**See Also**\n\n- [android.provider.CloudMediaProvider#onGetMediaCollectionInfo](/reference/kotlin/android/provider/CloudMediaProvider#onGetMediaCollectionInfo(android.os.Bundle)) \n\n### ACCOUNT_NAME\n\nAdded in [API level 33](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \nAlso in [R Extensions 3](https://developer.android.com/sdkExtensions) \n\n```\nstatic val ACCOUNT_NAME: String\n```\n\nName of the account that owns the media collection.\n\nType: STRING \n\n Value: \"account_name\"\n\n**See Also**\n\n- [android.provider.CloudMediaProvider#onGetMediaCollectionInfo](/reference/kotlin/android/provider/CloudMediaProvider#onGetMediaCollectionInfo(android.os.Bundle)) \n\n### LAST_MEDIA_SYNC_GENERATION\n\nAdded in [API level 33](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \nAlso in [R Extensions 3](https://developer.android.com/sdkExtensions) \n\n```\nstatic val LAST_MEDIA_SYNC_GENERATION: String\n```\n\nLast [CloudMediaProviderContract.MediaColumns.SYNC_GENERATION](/reference/kotlin/android/provider/CloudMediaProviderContract.MediaColumns#SYNC_GENERATION:kotlin.String) in the media collection including deleted media items.\n\nProviders 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.\n\nType: LONG \n\n Value: \"last_media_sync_generation\"\n\n**See Also**\n\n- [android.provider.CloudMediaProviderContract#EXTRA_SYNC_GENERATION](/reference/kotlin/android/provider/CloudMediaProviderContract#EXTRA_SYNC_GENERATION:kotlin.String)\n- [android.provider.CloudMediaProvider#onGetMediaCollectionInfo](/reference/kotlin/android/provider/CloudMediaProvider#onGetMediaCollectionInfo(android.os.Bundle))\n- [android.provider.CloudMediaProviderContract.MediaColumns#SYNC_GENERATION](/reference/kotlin/android/provider/CloudMediaProviderContract.MediaColumns#SYNC_GENERATION:kotlin.String) \n\n### MEDIA_COLLECTION_ID\n\nAdded in [API level 33](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \nAlso in [R Extensions 3](https://developer.android.com/sdkExtensions) \n\n```\nstatic val MEDIA_COLLECTION_ID: String\n```\n\nMedia collection identifier\n\nThe only requirement on the collection ID is uniqueness on a device.\n\nThis 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.\n\nApps are recommended to generate unique collection ids with, [UUID.randomUUID](../../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.\n\nType: STRING \n\n Value: \"media_collection_id\"\n\n**See Also**\n\n- [android.provider.CloudMediaProvider#onGetMediaCollectionInfo](/reference/kotlin/android/provider/CloudMediaProvider#onGetMediaCollectionInfo(android.os.Bundle))"]]