# WatchFaceMetadataClient

Artifact: [androidx.wear.watchface:watchface-client](https://developer.android.com/jetpack/androidx/releases/wear-watchface) [View Source](https://cs.android.com/search?q=file:androidx/wear/watchface/client/WatchFaceMetadataClient.kt+class:androidx.wear.watchface.client.WatchFaceMetadataClient) Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/wear-watchface#1.1.0) Deprecated in [1.3.0-alpha07](https://developer.android.com/jetpack/androidx/releases/wear-watchface#1.3.0-alpha07)

*** ** * ** ***

Kotlin \|[Java](https://developer.android.com/reference/androidx/wear/watchface/client/WatchFaceMetadataClient "View this page in Java")


```
interface WatchFaceMetadataClient : AutoCloseable
```

<br />

*** ** * ** ***

> [!CAUTION]
> **This interface is deprecated.**   
> AndroidX watchface libraries are deprecated, use Watch Face Format instead. For more info see: https://developer.android.com/training/wearables/wff

Interface for fetching watch face metadata. E.g. the `https://developer.android.com/reference/kotlin/androidx/wear/watchface/style/UserStyleSchema` and `https://developer.android.com/reference/kotlin/androidx/wear/watchface/client/ComplicationSlotMetadata`. This must be `https://developer.android.com/reference/java/lang/AutoCloseable.html#close()`d after use to release resources.

use Watch Face Format instead

## Summary

| ### Nested types |
|---|
| `class https://developer.android.com/reference/kotlin/androidx/wear/watchface/client/WatchFaceMetadataClient.ServiceNotBoundException : https://developer.android.com/reference/java/lang/Exception.html` **This class is deprecated.** AndroidX watchface libraries are deprecated, use Watch Face Format instead. |
| `class https://developer.android.com/reference/kotlin/androidx/wear/watchface/client/WatchFaceMetadataClient.ServiceStartFailureException : https://developer.android.com/reference/java/lang/Exception.html` **This class is deprecated.** AndroidX watchface libraries are deprecated, use Watch Face Format instead. |

| ### Public companion functions |
|---|---|
| `suspend https://developer.android.com/reference/kotlin/androidx/wear/watchface/client/WatchFaceMetadataClient` | `[create](https://developer.android.com/reference/kotlin/androidx/wear/watchface/client/WatchFaceMetadataClient#create(android.content.Context,android.content.ComponentName))(context: https://developer.android.com/reference/android/content/Context.html, watchFaceName: https://developer.android.com/reference/android/content/ComponentName.html)` **This function is deprecated.** AndroidX watchface libraries are deprecated, use Watch Face Format instead. |
| `suspend https://developer.android.com/reference/kotlin/androidx/wear/watchface/client/WatchFaceMetadataClient` | `[createForRuntime](https://developer.android.com/reference/kotlin/androidx/wear/watchface/client/WatchFaceMetadataClient#createForRuntime(android.content.Context,android.content.ComponentName,kotlin.String))( context: https://developer.android.com/reference/android/content/Context.html, watchFaceName: https://developer.android.com/reference/android/content/ComponentName.html, runtimePackage: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html )` **This function is deprecated.** AndroidX watchface libraries are deprecated, use Watch Face Format instead. |

| ### Public functions |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-map/index.html<https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html, https://developer.android.com/reference/kotlin/androidx/wear/watchface/client/ComplicationSlotMetadata>` | `[getComplicationSlotMetadataMap](https://developer.android.com/reference/kotlin/androidx/wear/watchface/client/WatchFaceMetadataClient#getComplicationSlotMetadataMap())()` **This function is deprecated.** AndroidX watchface libraries are deprecated, use Watch Face Format instead. |
| `https://developer.android.com/reference/kotlin/androidx/wear/watchface/style/UserStyleFlavors` | `[getUserStyleFlavors](https://developer.android.com/reference/kotlin/androidx/wear/watchface/client/WatchFaceMetadataClient#getUserStyleFlavors())()` **This function is deprecated.** AndroidX watchface libraries are deprecated, use Watch Face Format instead. |
| `https://developer.android.com/reference/kotlin/androidx/wear/watchface/style/UserStyleSchema` | `[getUserStyleSchema](https://developer.android.com/reference/kotlin/androidx/wear/watchface/client/WatchFaceMetadataClient#getUserStyleSchema())()` **This function is deprecated.** AndroidX watchface libraries are deprecated, use Watch Face Format instead. |

| ### Public properties |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | `https://developer.android.com/reference/kotlin/androidx/wear/watchface/client/WatchFaceMetadataClient#isUserStyleSchemaStatic()` **This property is deprecated.** AndroidX watchface libraries are deprecated, use Watch Face Format instead. |

| ### Inherited functions |
|---|
| From [java.lang.AutoCloseable](https://developer.android.com/reference/java/lang/AutoCloseable.html) |---|---| | `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `[close](https://developer.android.com/reference/java/lang/AutoCloseable.html#close())()` **This function is deprecated.** AndroidX watchface libraries are deprecated, use Watch Face Format instead. | |

## Public companion functions

### create

```
suspend fun [create](https://developer.android.com/reference/kotlin/androidx/wear/watchface/client/WatchFaceMetadataClient#create(android.content.Context,android.content.ComponentName))(context: Context, watchFaceName: ComponentName): WatchFaceMetadataClient
```

> [!CAUTION]
> **This function is deprecated.**   
> AndroidX watchface libraries are deprecated, use Watch Face Format instead. For more info see: https://developer.android.com/training/wearables/wff

Constructs a `https://developer.android.com/reference/kotlin/androidx/wear/watchface/client/WatchFaceMetadataClient` for fetching metadata for the specified watch face.

| Parameters |
|---|---|
| `context: https://developer.android.com/reference/android/content/Context.html` | Calling application's `https://developer.android.com/reference/android/content/Context.html`. |
| `watchFaceName: https://developer.android.com/reference/android/content/ComponentName.html` | The `https://developer.android.com/reference/android/content/ComponentName.html` of the watch face to fetch meta data from. |

| Returns |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/wear/watchface/client/WatchFaceMetadataClient` | The `https://developer.android.com/reference/kotlin/androidx/wear/watchface/client/WatchFaceMetadataClient` if there is one. |

| Throws |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/wear/watchface/client/WatchFaceMetadataClient.ServiceNotBoundException` | if the underlying watch face control service can not be bound or a `https://developer.android.com/reference/kotlin/androidx/wear/watchface/client/WatchFaceMetadataClient.ServiceStartFailureException` if the watch face dies during startup. If the service's manifest contains an androidx.wear.watchface.XmlSchemaAndComplicationSlotsDefinition meta data node then `https://developer.android.com/reference/android/content/pm/PackageManager.NameNotFoundException.html` is thrown if `https://developer.android.com/reference/kotlin/androidx/wear/watchface/client/WatchFaceMetadataClient.Companion#create(android.content.Context,android.content.ComponentName)` is invalid. |

### createForRuntime

```
suspend fun [createForRuntime](https://developer.android.com/reference/kotlin/androidx/wear/watchface/client/WatchFaceMetadataClient#createForRuntime(android.content.Context,android.content.ComponentName,kotlin.String))(
    context: Context,
    watchFaceName: ComponentName,
    runtimePackage: String
): WatchFaceMetadataClient
```

> [!CAUTION]
> **This function is deprecated.**   
> AndroidX watchface libraries are deprecated, use Watch Face Format instead. For more info see: https://developer.android.com/training/wearables/wff

Constructs a `https://developer.android.com/reference/kotlin/androidx/wear/watchface/client/WatchFaceMetadataClient` for fetching metadata for the specified resource only watch face from its runtime. A resource only watch face runtime is a special watch face that knows how to load watch faces from resources in another package that contains only resources and no executable code.

| Parameters |
|---|---|
| `context: https://developer.android.com/reference/android/content/Context.html` | Calling application's `https://developer.android.com/reference/android/content/Context.html`. |
| `watchFaceName: https://developer.android.com/reference/android/content/ComponentName.html` | The `https://developer.android.com/reference/android/content/ComponentName.html` of the watch face to fetch meta data from. |
| `runtimePackage: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html` | The package that contains the Resource only Watch Face runtime. |

| Returns |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/wear/watchface/client/WatchFaceMetadataClient` | The `https://developer.android.com/reference/kotlin/androidx/wear/watchface/client/WatchFaceMetadataClient` if there is one. |

| Throws |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/wear/watchface/client/WatchFaceMetadataClient.ServiceNotBoundException` | if the underlying watch face control service can not be bound or a `https://developer.android.com/reference/kotlin/androidx/wear/watchface/client/WatchFaceMetadataClient.ServiceStartFailureException` if the watch face dies during startup. If the service's manifest contains an androidx.wear.watchface.XmlSchemaAndComplicationSlotsDefinition meta data node then `https://developer.android.com/reference/android/content/pm/PackageManager.NameNotFoundException.html` is thrown if `https://developer.android.com/reference/kotlin/androidx/wear/watchface/client/WatchFaceMetadataClient.Companion#createForRuntime(android.content.Context,android.content.ComponentName,kotlin.String)` is invalid. |

## Public functions

### getComplicationSlotMetadataMap

Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/wear-watchface#1.1.0) Deprecated in [1.3.0-alpha07](https://developer.android.com/jetpack/androidx/releases/wear-watchface#1.3.0-alpha07)

```
fun [getComplicationSlotMetadataMap](https://developer.android.com/reference/kotlin/androidx/wear/watchface/client/WatchFaceMetadataClient#getComplicationSlotMetadataMap())(): Map<Int, ComplicationSlotMetadata>
```

> [!CAUTION]
> **This function is deprecated.**   
> AndroidX watchface libraries are deprecated, use Watch Face Format instead. For more info see: https://developer.android.com/training/wearables/wff

Returns a map of `https://developer.android.com/reference/kotlin/androidx/wear/watchface/ComplicationSlot` ID to `https://developer.android.com/reference/kotlin/androidx/wear/watchface/client/ComplicationSlotMetadata` for each slot in the watch face's `https://developer.android.com/reference/kotlin/androidx/wear/watchface/ComplicationSlotsManager`.

| Throws |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-runtime-exception/index.html` | if the watch face threw an exception while trying to service the request or there was a communication problem with watch face process. |

### getUserStyleFlavors

Added in [1.2.0](https://developer.android.com/jetpack/androidx/releases/wear-watchface#1.2.0) Deprecated in [1.3.0-alpha07](https://developer.android.com/jetpack/androidx/releases/wear-watchface#1.3.0-alpha07)

```
fun [getUserStyleFlavors](https://developer.android.com/reference/kotlin/androidx/wear/watchface/client/WatchFaceMetadataClient#getUserStyleFlavors())(): UserStyleFlavors
```

> [!CAUTION]
> **This function is deprecated.**   
> AndroidX watchface libraries are deprecated, use Watch Face Format instead. For more info see: https://developer.android.com/training/wearables/wff

Returns the watch face's `https://developer.android.com/reference/kotlin/androidx/wear/watchface/style/UserStyleFlavors`.

| Throws |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-runtime-exception/index.html` | if the watch face threw an exception while trying to service the request or there was a communication problem with watch face process. |

### getUserStyleSchema

Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/wear-watchface#1.1.0) Deprecated in [1.3.0-alpha07](https://developer.android.com/jetpack/androidx/releases/wear-watchface#1.3.0-alpha07)

```
fun [getUserStyleSchema](https://developer.android.com/reference/kotlin/androidx/wear/watchface/client/WatchFaceMetadataClient#getUserStyleSchema())(): UserStyleSchema
```

> [!CAUTION]
> **This function is deprecated.**   
> AndroidX watchface libraries are deprecated, use Watch Face Format instead. For more info see: https://developer.android.com/training/wearables/wff

Returns the watch face's `https://developer.android.com/reference/kotlin/androidx/wear/watchface/style/UserStyleSchema`.

| Throws |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-runtime-exception/index.html` | if the watch face threw an exception while trying to service the request or there was a communication problem with watch face process. |

## Public properties

### isUserStyleSchemaStatic

Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/wear-watchface#1.1.0) Deprecated in [1.3.0-alpha07](https://developer.android.com/jetpack/androidx/releases/wear-watchface#1.3.0-alpha07)

```
val isUserStyleSchemaStatic: Boolean
```

> [!CAUTION]
> **This property is deprecated.**   
> AndroidX watchface libraries are deprecated, use Watch Face Format instead. For more info see: https://developer.android.com/training/wearables/wff

Whether or not the `https://developer.android.com/reference/kotlin/androidx/wear/watchface/style/UserStyleSchema` is static and won't change unless the APK is updated.