# RemoteWatchFaceViewHost

# 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)

*** ** * ** ***

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

<br />

```
interface RemoteWatchFaceViewHost : AutoCloseable
```

<br />

*** ** * ** ***

| **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[SurfaceControlViewHost.SurfacePackage](https://developer.android.com/reference/android/view/SurfaceControlViewHost.SurfacePackage.html)to the client, which the client can attach to a[SurfaceView](https://developer.android.com/reference/android/view/SurfaceView.html)with[SurfaceView.setChildSurfacePackage](https://developer.android.com/reference/android/view/SurfaceView.html#setChildSurfacePackage(android.view.SurfaceControlViewHost.SurfacePackage)). The client can request an updated screen shot by calling[renderWatchFace](https://developer.android.com/reference/kotlin/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 functions                              |
|-------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [Unit](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html) | ~~[renderWatchFace](https://developer.android.com/reference/kotlin/androidx/wear/watchface/client/RemoteWatchFaceViewHost#renderWatchFace(androidx.wear.watchface.RenderParameters,java.time.Instant,androidx.wear.watchface.style.UserStyle,kotlin.collections.Map))~~`(` ` renderParameters: `[RenderParameters](https://developer.android.com/reference/kotlin/androidx/wear/watchface/RenderParameters)`,` ` instant: `[Instant](https://developer.android.com/reference/java/time/Instant.html)`,` ` userStyle: `[UserStyle](https://developer.android.com/reference/kotlin/androidx/wear/watchface/style/UserStyle)`?,` ` idAndComplicationData: `[Map](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-map/index.html)`<`[Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)`, `[ComplicationData](https://developer.android.com/reference/kotlin/androidx/wear/watchface/complications/data/ComplicationData)`>?` `)` **This function is deprecated.**AndroidX watchface libraries are deprecated, use Watch Face Format instead. |

|                                                          ### Public properties                                                           |
|------------------------------------------------------------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [SurfaceControlViewHost.SurfacePackage](https://developer.android.com/reference/android/view/SurfaceControlViewHost.SurfacePackage.html) | [surfacePackage](https://developer.android.com/reference/kotlin/androidx/wear/watchface/client/RemoteWatchFaceViewHost#surfacePackage()) **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) |-------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | [Unit](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 functions

### renderWatchFace

```
fun [renderWatchFace](https://developer.android.com/reference/kotlin/androidx/wear/watchface/client/RemoteWatchFaceViewHost#renderWatchFace(androidx.wear.watchface.RenderParameters,java.time.Instant,androidx.wear.watchface.style.UserStyle,kotlin.collections.Map))(
    renderParameters: RenderParameters,
    instant: Instant,
    userStyle: UserStyle?,
    idAndComplicationData: Map<Int, ComplicationData>?
): Unit
```
| **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

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

|                                                                                                                                                              Parameters                                                                                                                                                              |
|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `renderParameters: `[RenderParameters](https://developer.android.com/reference/kotlin/androidx/wear/watchface/RenderParameters)                                                                                                                                                                                                      | The[RenderParameters](https://developer.android.com/reference/kotlin/androidx/wear/watchface/RenderParameters)to draw with.                                                                                                            |
| `instant: `[Instant](https://developer.android.com/reference/java/time/Instant.html)                                                                                                                                                                                                                                                 | The[Instant](https://developer.android.com/reference/java/time/Instant.html)render with.                                                                                                                                               |
| `userStyle: `[UserStyle](https://developer.android.com/reference/kotlin/androidx/wear/watchface/style/UserStyle)`?`                                                                                                                                                                                                                  | Optional[UserStyle](https://developer.android.com/reference/kotlin/androidx/wear/watchface/style/UserStyle)to render with, if null the current style is used.                                                                          |
| `idAndComplicationData: `[Map](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-map/index.html)`<`[Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)`, `[ComplicationData](https://developer.android.com/reference/kotlin/androidx/wear/watchface/complications/data/ComplicationData)`>?` | Map of complication ids to[ComplicationData](https://developer.android.com/reference/kotlin/androidx/wear/watchface/complications/data/ComplicationData)to render with, or if null then the existing complication data if any is used. |

## Public properties

### surfacePackage

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)  

```
val surfacePackage: SurfaceControlViewHost.SurfacePackage
```
| **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

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