# PlatformDataKey

Artifact: [androidx.wear.protolayout:protolayout-expression](https://developer.android.com/jetpack/androidx/releases/wear-protolayout) [View Source](https://cs.android.com/search?q=file:androidx/wear/protolayout/expression/PlatformDataKey.java+class:androidx.wear.protolayout.expression.PlatformDataKey) Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/wear-protolayout#1.0.0)

*** ** * ** ***


```
class PlatformDataKey<T : DynamicBuilders.DynamicType?> : DynamicDataKey<T!>
```

<br />

|---|---|---|
| [kotlin.Any](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html) |||
| ↳ | [androidx.wear.protolayout.expression.DynamicDataKey](https://developer.android.com/reference/kotlin/androidx/wear/protolayout/expression/DynamicDataKey)\<T!\> ||
|   | ↳ | [androidx.wear.protolayout.expression.PlatformDataKey](https://developer.android.com/reference/kotlin/androidx/wear/protolayout/expression/PlatformDataKey) |

*** ** * ** ***

Represent a `https://developer.android.com/reference/kotlin/androidx/wear/protolayout/expression/DynamicDataKey` that references real-time data from the platform.

The \[namespace, key\] tuple creates the actual reference, so that a single key can refer to two different sources in two different namespaces.

The namespace must not be empty. Additionally, the "protolayout" namespace (and its lowercase and uppercase variations) are reserved for the default platform data sources and should not be used for any custom OEM data source. To make sure namespaces are unique, any custom namespace is expected to follow Java style naming `com.company.foo`.

| Parameters |
|---|---|
| `<T : https://developer.android.com/reference/kotlin/androidx/wear/protolayout/expression/DynamicBuilders.DynamicType?>` | The data type of the dynamic values that this key is bound to. |

## Summary

| ### Public constructors |
|---|
| `https://developer.android.com/reference/kotlin/androidx/wear/protolayout/expression/PlatformDataKey#PlatformDataKey(java.lang.String,java.lang.String)(namespace: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html, key: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)` Create a `https://developer.android.com/reference/kotlin/androidx/wear/protolayout/expression/PlatformDataKey` with the specified key in the given namespace. |

### Inherited functions

From [androidx.wear.protolayout.expression.DynamicDataKey](https://developer.android.com/reference/kotlin/androidx/wear/protolayout/expression/DynamicDataKey) `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` `https://developer.android.com/reference/kotlin/androidx/wear/protolayout/expression/DynamicDataKey#equals(java.lang.Object)(other: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html!)` `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` `https://developer.android.com/reference/kotlin/androidx/wear/protolayout/expression/DynamicDataKey#hashCode()()` `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!` `https://developer.android.com/reference/kotlin/androidx/wear/protolayout/expression/DynamicDataKey#toString()()`

### Inherited properties

From [androidx.wear.protolayout.expression.DynamicDataKey](https://developer.android.com/reference/kotlin/androidx/wear/protolayout/expression/DynamicDataKey) `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!` `https://developer.android.com/reference/kotlin/androidx/wear/protolayout/expression/DynamicDataKey#key()` `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!` `https://developer.android.com/reference/kotlin/androidx/wear/protolayout/expression/DynamicDataKey#namespace()`

## Public constructors

### PlatformDataKey

Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/wear-protolayout#1.0.0)

```
PlatformDataKey(namespace: String, key: String)
```

Create a `https://developer.android.com/reference/kotlin/androidx/wear/protolayout/expression/PlatformDataKey` with the specified key in the given namespace.

| Parameters |
|---|---|
| `namespace: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html` | The namespace of the key for the platform data source. |
| `key: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html` | The key that references the platform data source. |