# 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)
public final class RequestBuilders.TileRequest
```

<br />

*** ** * ** ***

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

## Summary

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

| ### Public methods |
|---|---|
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/wear/protolayout/StateBuilders.State` | `https://developer.android.com/reference/androidx/wear/tiles/RequestBuilders.TileRequest#getCurrentState()()` Gets the `https://developer.android.com/reference/androidx/wear/protolayout/StateBuilders.State` that should be used when building the tile. |
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/wear/protolayout/DeviceParametersBuilders.DeviceParameters` | `https://developer.android.com/reference/androidx/wear/tiles/RequestBuilders.TileRequest#getDeviceConfiguration()()` Gets the `https://developer.android.com/reference/androidx/wear/protolayout/DeviceParametersBuilders.DeviceParameters` object describing the device requesting the tile update. |
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/Nullable.html https://developer.android.com/reference/androidx/wear/tiles/DeviceParametersBuilders.DeviceParameters` | `[getDeviceParameters](https://developer.android.com/reference/androidx/wear/tiles/RequestBuilders.TileRequest#getDeviceParameters())()` **This method is deprecated.** Use `https://developer.android.com/reference/androidx/wear/tiles/RequestBuilders.TileRequest#getDeviceConfiguration()` instead. <br /> |
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/java/time/Instant.html` | `@https://developer.android.com/reference/androidx/wear/protolayout/expression/RequiresSchemaVersion(major = 1, minor = 600) https://developer.android.com/reference/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://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/wear/protolayout/ProtoLayoutScope` | `https://developer.android.com/reference/androidx/wear/tiles/RequestBuilders.TileRequest#getScope()()` Returns `https://developer.android.com/reference/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://jspecify.dev/docs/api/org/jspecify/annotations/Nullable.html https://developer.android.com/reference/androidx/wear/tiles/StateBuilders.State` | `[getState](https://developer.android.com/reference/androidx/wear/tiles/RequestBuilders.TileRequest#getState())()` **This method is deprecated.** Use `https://developer.android.com/reference/androidx/wear/tiles/RequestBuilders.TileRequest#getCurrentState()` instead. <br /> |
| `int` | `https://developer.android.com/reference/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://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/java/lang/String.html` | `https://developer.android.com/reference/androidx/wear/tiles/RequestBuilders.TileRequest#toString()()` |

## Public methods

### getCurrentState

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

```
public @NonNull StateBuilders.State getCurrentState()
```

Gets the `https://developer.android.com/reference/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)

```
public @NonNull DeviceParametersBuilders.DeviceParameters getDeviceConfiguration()
```

Gets the `https://developer.android.com/reference/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)

```
public @Nullable DeviceParametersBuilders.DeviceParameters [getDeviceParameters](https://developer.android.com/reference/androidx/wear/tiles/RequestBuilders.TileRequest#getDeviceParameters())()
```

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

Gets the `https://developer.android.com/reference/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)
public @NonNull Instant getLastVisibleTime()
```

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)

```
public @NonNull ProtoLayoutScope getScope()
```

Returns `https://developer.android.com/reference/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)

```
public @Nullable StateBuilders.State [getState](https://developer.android.com/reference/androidx/wear/tiles/RequestBuilders.TileRequest#getState())()
```

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

Gets the `https://developer.android.com/reference/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)

```
public int getTileId()
```

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

```
public @NonNull String toString()
```