# RequestBuilders.TileRequest

Artifact: [androidx.wear.tiles:tiles](https://developer.android.com/jetpack/androidx/releases/wear-tiles) [View Source](https://cs.android.com/search?q=file:androidx/wear/tiles/RequestBuilders.java+class:androidx.wear.tiles.RequestBuilders.TileRequest) Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/wear-tiles#1.0.0)

*** ** * ** ***


```
@RequiresSchemaVersion(major = 1, minor = 0)
class RequestBuilders.TileRequest
```

<br />

*** ** * ** ***

Parameters passed to a `https://developer.android.com/reference/kotlin/androidx/wear/tiles/TileBuilders.Tile` Service when the renderer is requesting a new version of the tile.

## Summary

| ### Nested types |
|---|
| `class https://developer.android.com/reference/kotlin/androidx/wear/tiles/RequestBuilders.TileRequest.Builder` Builder for `https://developer.android.com/reference/kotlin/androidx/wear/tiles/RequestBuilders.TileRequest` |

| ### Public functions |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/wear/protolayout/StateBuilders.State` | `https://developer.android.com/reference/kotlin/androidx/wear/tiles/RequestBuilders.TileRequest#getCurrentState()()` Gets the `https://developer.android.com/reference/kotlin/androidx/wear/protolayout/StateBuilders.State` that should be used when building the tile. |
| `https://developer.android.com/reference/kotlin/androidx/wear/protolayout/DeviceParametersBuilders.DeviceParameters` | `https://developer.android.com/reference/kotlin/androidx/wear/tiles/RequestBuilders.TileRequest#getDeviceConfiguration()()` Gets the `https://developer.android.com/reference/kotlin/androidx/wear/protolayout/DeviceParametersBuilders.DeviceParameters` object describing the device requesting the tile update. |
| `https://developer.android.com/reference/kotlin/androidx/wear/tiles/DeviceParametersBuilders.DeviceParameters?` | `[getDeviceParameters](https://developer.android.com/reference/kotlin/androidx/wear/tiles/RequestBuilders.TileRequest#getDeviceParameters())()` **This function is deprecated.** Use `https://developer.android.com/reference/kotlin/androidx/wear/tiles/RequestBuilders.TileRequest#getDeviceConfiguration()` instead. <br /> |
| `https://developer.android.com/reference/java/time/Instant.html` | `@https://developer.android.com/reference/kotlin/androidx/wear/protolayout/expression/RequiresSchemaVersion(major = 1, minor = 600) https://developer.android.com/reference/kotlin/androidx/wear/tiles/RequestBuilders.TileRequest#getLastVisibleTime()()` Gets the `https://developer.android.com/reference/java/time/Instant.html` representing the last time the tile was visible. |
| `https://developer.android.com/reference/kotlin/androidx/wear/protolayout/ProtoLayoutScope` | `https://developer.android.com/reference/kotlin/androidx/wear/tiles/RequestBuilders.TileRequest#getScope()()` Returns `https://developer.android.com/reference/kotlin/androidx/wear/protolayout/ProtoLayoutScope` object that is required for methods to create resources or pending intents, and it will automatically register them for a tile. |
| `https://developer.android.com/reference/kotlin/androidx/wear/tiles/StateBuilders.State?` | `[getState](https://developer.android.com/reference/kotlin/androidx/wear/tiles/RequestBuilders.TileRequest#getState())()` **This function is deprecated.** Use `https://developer.android.com/reference/kotlin/androidx/wear/tiles/RequestBuilders.TileRequest#getCurrentState()` instead. <br /> |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/wear/tiles/RequestBuilders.TileRequest#getTileId()()` Gets the instance ID of the tile being requested, allocated when the tile instance is added to the carousel. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html` | `https://developer.android.com/reference/kotlin/androidx/wear/tiles/RequestBuilders.TileRequest#toString()()` |

## Public functions

### getCurrentState

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

```
fun getCurrentState(): StateBuilders.State
```

Gets the `https://developer.android.com/reference/kotlin/androidx/wear/protolayout/StateBuilders.State` that should be used when building the tile.

### getDeviceConfiguration

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

```
fun getDeviceConfiguration(): DeviceParametersBuilders.DeviceParameters
```

Gets the `https://developer.android.com/reference/kotlin/androidx/wear/protolayout/DeviceParametersBuilders.DeviceParameters` object describing the device requesting the tile update. If not set, a default empty instance is used.

### getDeviceParameters

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

```
fun [getDeviceParameters](https://developer.android.com/reference/kotlin/androidx/wear/tiles/RequestBuilders.TileRequest#getDeviceParameters())(): DeviceParametersBuilders.DeviceParameters?
```

> [!CAUTION]
> **This function is deprecated.**   
>
> Use `https://developer.android.com/reference/kotlin/androidx/wear/tiles/RequestBuilders.TileRequest#getDeviceConfiguration()` instead.

Gets the `https://developer.android.com/reference/kotlin/androidx/wear/tiles/DeviceParametersBuilders.DeviceParameters` object describing the device requesting the tile update.

### getLastVisibleTime

Added in [1.6.2](https://developer.android.com/jetpack/androidx/releases/wear-tiles#1.6.2)

```
@RequiresSchemaVersion(major = 1, minor = 600)
fun getLastVisibleTime(): Instant
```

Gets the `https://developer.android.com/reference/java/time/Instant.html` representing the last time the tile was visible.

If the tile has never been visible, or the last time it was visible is not known, this will return `https://developer.android.com/reference/java/time/Instant.html#EPOCH`.

The returned value is not persistent across reboots or when the tile is removed from the carousel and added again.

### getScope

Added in [1.6.2](https://developer.android.com/jetpack/androidx/releases/wear-tiles#1.6.2)

```
fun getScope(): ProtoLayoutScope
```

Returns `https://developer.android.com/reference/kotlin/androidx/wear/protolayout/ProtoLayoutScope` object that is required for methods to create resources or pending intents, and it will automatically register them for a tile.

### getState

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

```
fun [getState](https://developer.android.com/reference/kotlin/androidx/wear/tiles/RequestBuilders.TileRequest#getState())(): StateBuilders.State?
```

> [!CAUTION]
> **This function is deprecated.**   
>
> Use `https://developer.android.com/reference/kotlin/androidx/wear/tiles/RequestBuilders.TileRequest#getCurrentState()` instead.

Gets the `https://developer.android.com/reference/kotlin/androidx/wear/tiles/StateBuilders.State` that should be used when building the tile.

### getTileId

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

```
fun getTileId(): Int
```

Gets the instance ID of the tile being requested, allocated when the tile instance is added to the carousel. This ID will remain the same for this tile instance as long it is not removed from the carousel.

### toString

```
fun toString(): String
```