# WatchFaceMetadataClient.Companion

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.Companion) 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)

*** ** * ** ***


```
public static class WatchFaceMetadataClient.Companion
```

<br />

*** ** * ** ***

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

## Summary

| ### Public methods |
|---|---|
| `static final @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/wear/watchface/client/WatchFaceMetadataClient` | `[create](https://developer.android.com/reference/androidx/wear/watchface/client/WatchFaceMetadataClient.Companion#create(android.content.Context,android.content.ComponentName))(@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/android/content/Context.html context, @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/android/content/ComponentName.html watchFaceName)` **This method is deprecated.** AndroidX watchface libraries are deprecated, use Watch Face Format instead. |
| `static final @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/wear/watchface/client/WatchFaceMetadataClient` | `[createForRuntime](https://developer.android.com/reference/androidx/wear/watchface/client/WatchFaceMetadataClient.Companion#createForRuntime(android.content.Context,android.content.ComponentName,kotlin.String))( @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/android/content/Context.html context, @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/android/content/ComponentName.html watchFaceName, @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/String.html runtimePackage )` **This method is deprecated.** AndroidX watchface libraries are deprecated, use Watch Face Format instead. |

## Public methods

### create

```
public static final @NonNull WatchFaceMetadataClient [create](https://developer.android.com/reference/androidx/wear/watchface/client/WatchFaceMetadataClient.Companion#create(android.content.Context,android.content.ComponentName))(@NonNull Context context, @NonNull ComponentName watchFaceName)
```

> [!CAUTION]
> **This method 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/androidx/wear/watchface/client/WatchFaceMetadataClient` for fetching metadata for the specified watch face.

| Parameters |
|---|---|
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/android/content/Context.html context` | Calling application's `https://developer.android.com/reference/android/content/Context.html`. |
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/android/content/ComponentName.html watchFaceName` | 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/androidx/annotation/NonNull https://developer.android.com/reference/androidx/wear/watchface/client/WatchFaceMetadataClient` | The `https://developer.android.com/reference/androidx/wear/watchface/client/WatchFaceMetadataClient` if there is one. |

| Throws |
|---|---|
| `https://developer.android.com/reference/androidx/wear/watchface/client/WatchFaceMetadataClient.ServiceNotBoundException` | if the underlying watch face control service can not be bound or a `https://developer.android.com/reference/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/androidx/wear/watchface/client/WatchFaceMetadataClient.Companion#create(android.content.Context,android.content.ComponentName)` is invalid. |

### createForRuntime

```
public static final @NonNull WatchFaceMetadataClient [createForRuntime](https://developer.android.com/reference/androidx/wear/watchface/client/WatchFaceMetadataClient.Companion#createForRuntime(android.content.Context,android.content.ComponentName,kotlin.String))(
    @NonNull Context context,
    @NonNull ComponentName watchFaceName,
    @NonNull String runtimePackage
)
```

> [!CAUTION]
> **This method 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/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 |
|---|---|
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/android/content/Context.html context` | Calling application's `https://developer.android.com/reference/android/content/Context.html`. |
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/android/content/ComponentName.html watchFaceName` | The `https://developer.android.com/reference/android/content/ComponentName.html` of the watch face to fetch meta data from. |
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/String.html runtimePackage` | The package that contains the Resource only Watch Face runtime. |

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

| Throws |
|---|---|
| `https://developer.android.com/reference/androidx/wear/watchface/client/WatchFaceMetadataClient.ServiceNotBoundException` | if the underlying watch face control service can not be bound or a `https://developer.android.com/reference/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/androidx/wear/watchface/client/WatchFaceMetadataClient.Companion#createForRuntime(android.content.Context,android.content.ComponentName,kotlin.String)` is invalid. |