# RemoteWatchFaceViewHost

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/InteractiveWatchFaceClient.kt+class:androidx.wear.watchface.client.RemoteWatchFaceViewHost) 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)

*** ** * ** ***


```
public interface RemoteWatchFaceViewHost extends 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

Intended for use by watch face editors, a RemoteWatchFaceViewHost allows the watch face to send a `https://developer.android.com/reference/android/view/SurfaceControlViewHost.SurfacePackage.html` to the client, which the client can attach to a `https://developer.android.com/reference/android/view/SurfaceView.html` with `https://developer.android.com/reference/android/view/SurfaceView.html#setChildSurfacePackage(android.view.SurfaceControlViewHost.SurfacePackage)`. The client can request an updated screen shot by calling `https://developer.android.com/reference/androidx/wear/watchface/client/RemoteWatchFaceViewHost#renderWatchFace(androidx.wear.watchface.RenderParameters,java.time.Instant,androidx.wear.watchface.style.UserStyle,kotlin.collections.Map)`.

use Watch Face Format instead

## Summary

| ### Public methods |
|---|---|
| `abstract @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/android/view/SurfaceControlViewHost.SurfacePackage.html` | `[getSurfacePackage](https://developer.android.com/reference/androidx/wear/watchface/client/RemoteWatchFaceViewHost#getSurfacePackage())()` **This method is deprecated.** AndroidX watchface libraries are deprecated, use Watch Face Format instead. |
| `abstract void` | `[renderWatchFace](https://developer.android.com/reference/androidx/wear/watchface/client/RemoteWatchFaceViewHost#renderWatchFace(androidx.wear.watchface.RenderParameters,java.time.Instant,androidx.wear.watchface.style.UserStyle,kotlin.collections.Map))( @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/wear/watchface/RenderParameters renderParameters, @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/time/Instant.html instant, https://developer.android.com/reference/androidx/wear/watchface/style/UserStyle userStyle, https://developer.android.com/reference/java/util/Map.html<@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/Integer.html, @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/wear/watchface/complications/data/ComplicationData> idAndComplicationData )` **This method is deprecated.** AndroidX watchface libraries are deprecated, use Watch Face Format instead. |

| ### Inherited methods |
|---|
| From [java.lang.AutoCloseable](https://developer.android.com/reference/java/lang/AutoCloseable.html) |---|---| | `abstract void` | `[close](https://developer.android.com/reference/java/lang/AutoCloseable.html#close())()` **This method is deprecated.** AndroidX watchface libraries are deprecated, use Watch Face Format instead. | |

## Public methods

### getSurfacePackage

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)

```
abstract @NonNull SurfaceControlViewHost.SurfacePackage [getSurfacePackage](https://developer.android.com/reference/androidx/wear/watchface/client/RemoteWatchFaceViewHost#getSurfacePackage())()
```

> [!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

The `https://developer.android.com/reference/android/view/SurfaceControlViewHost.SurfacePackage.html` the client should attach to a `https://developer.android.com/reference/android/view/SurfaceView.html` via `https://developer.android.com/reference/android/view/SurfaceView.html#setChildSurfacePackage(android.view.SurfaceControlViewHost.SurfacePackage)`. The watch face will render into this view when `https://developer.android.com/reference/androidx/wear/watchface/client/RemoteWatchFaceViewHost#renderWatchFace(androidx.wear.watchface.RenderParameters,java.time.Instant,androidx.wear.watchface.style.UserStyle,kotlin.collections.Map)` is called.

### renderWatchFace

```
abstract void [renderWatchFace](https://developer.android.com/reference/androidx/wear/watchface/client/RemoteWatchFaceViewHost#renderWatchFace(androidx.wear.watchface.RenderParameters,java.time.Instant,androidx.wear.watchface.style.UserStyle,kotlin.collections.Map))(
    @NonNull RenderParameters renderParameters,
    @NonNull Instant instant,
    UserStyle userStyle,
    Map<@NonNull Integer, @NonNull ComplicationData> idAndComplicationData
)
```

> [!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

Renders the watchface into the view associated with `https://developer.android.com/reference/androidx/wear/watchface/client/RemoteWatchFaceViewHost#surfacePackage()`.

| Parameters |
|---|---|
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/wear/watchface/RenderParameters renderParameters` | The `https://developer.android.com/reference/androidx/wear/watchface/RenderParameters` to draw with. |
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/time/Instant.html instant` | The `https://developer.android.com/reference/java/time/Instant.html` render with. |
| `https://developer.android.com/reference/androidx/wear/watchface/style/UserStyle userStyle` | Optional `https://developer.android.com/reference/androidx/wear/watchface/style/UserStyle` to render with, if null the current style is used. |
| `https://developer.android.com/reference/java/util/Map.html<@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/Integer.html, @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/wear/watchface/complications/data/ComplicationData> idAndComplicationData` | Map of complication ids to `https://developer.android.com/reference/androidx/wear/watchface/complications/data/ComplicationData` to render with, or if null then the existing complication data if any is used. |