<div class='sourceset sourceset-android'>Android</div>

```kotlin
@ExperimentalGlanceRemoteViewsApi
public class GlanceRemoteViews
```

Object containing the information needed to generate a `RemoteViews`. The same instance should be
reused to compose layouts for a host view.

## Functions

<h2 id="compose-context-size-state-appwidgetoptions-content">compose</h2>

```kotlin
public suspend fun compose(
        context: Context,
        size: DpSize,
        state: Any? = null,
        appWidgetOptions: Bundle = Bundle(),
        content: @Composable () -> Unit,
    ): RemoteViewsCompositionResult
```

Triggers the composition of [content](/jetpack-compose/androidx.glance/glance-appwidget/classes/GlanceRemoteViews) and returns the result.

#### Parameters

| | |
| --- | --- |
| context | The [Context](https://developer.android.com/reference/android/content/Context) to get the resources during `RemoteViews` building. |
| state | Local view state that can be passed to composition through [LocalState](/jetpack-compose/androidx.glance/glance/properties/LocalState). |
| size | Size of the `RemoteViews` to be displayed at. |
| appWidgetOptions | AppWidget options `Bundle` to be passed to composition through [LocalAppWidgetOptions](/jetpack-compose/androidx.glance/glance-appwidget/properties/LocalAppWidgetOptions). |
| content | Definition of the UI. |

#### Returns

| | |
| --- | --- |
|  | Composition result containing the `RemoteViews`. |