# TileBuilders.Tile.Builder

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/TileBuilders.java+class:androidx.wear.tiles.TileBuilders.Tile.Builder) Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/wear-tiles#1.0.0)

*** ** * ** ***


```
public final class TileBuilders.Tile.Builder
```

<br />

*** ** * ** ***

Builder for `https://developer.android.com/reference/androidx/wear/tiles/TileBuilders.Tile`

## Summary

| ### Public constructors |
|---|
| `@https://developer.android.com/reference/androidx/wear/protolayout/expression/RequiresSchemaVersion(major = 1, minor = 0) https://developer.android.com/reference/androidx/wear/tiles/TileBuilders.Tile.Builder#Builder()()` Creates an instance of `https://developer.android.com/reference/androidx/wear/tiles/TileBuilders.Tile.Builder`. |

| ### Public methods |
|---|---|
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/wear/tiles/TileBuilders.Tile` | `https://developer.android.com/reference/androidx/wear/tiles/TileBuilders.Tile.Builder#build()()` Builds an instance from accumulated values. |
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/wear/tiles/TileBuilders.Tile.Builder` | `@https://developer.android.com/reference/androidx/wear/protolayout/expression/RequiresSchemaVersion(major = 1, minor = 0) https://developer.android.com/reference/androidx/wear/tiles/TileBuilders.Tile.Builder#setFreshnessIntervalMillis(long)(long freshnessIntervalMillis)` Sets how many milliseconds of elapsed time (\*\*not\*\* wall clock time) this tile can be considered to be "fresh". |
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/wear/tiles/TileBuilders.Tile.Builder` | `@https://developer.android.com/reference/androidx/wear/protolayout/expression/RequiresSchemaVersion(major = 1, minor = 0) https://developer.android.com/reference/androidx/wear/tiles/TileBuilders.Tile.Builder#setResourcesVersion(java.lang.String)(@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/java/lang/String.html resourcesVersion)` Sets the resource version required for these tiles. |
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/wear/tiles/TileBuilders.Tile.Builder` | `@https://developer.android.com/reference/androidx/wear/protolayout/expression/RequiresSchemaVersion(major = 1, minor = 200) https://developer.android.com/reference/androidx/wear/tiles/TileBuilders.Tile.Builder#setState(androidx.wear.protolayout.StateBuilders.State)(@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/wear/protolayout/StateBuilders.State state)` Sets `https://developer.android.com/reference/androidx/wear/protolayout/StateBuilders.State` for this tile. |
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/wear/tiles/TileBuilders.Tile.Builder` | `@https://developer.android.com/reference/androidx/wear/protolayout/expression/RequiresSchemaVersion(major = 1, minor = 0) https://developer.android.com/reference/androidx/wear/tiles/TileBuilders.Tile.Builder#setTileTimeline(androidx.wear.protolayout.TimelineBuilders.Timeline)(@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/wear/protolayout/TimelineBuilders.Timeline tileTimeline)` Sets the `https://developer.android.com/reference/androidx/wear/protolayout/TimelineBuilders.Timeline` containing the layouts for the tiles to show in the carousel, along with their validity periods. |
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/wear/tiles/TileBuilders.Tile.Builder` | `[setTimeline](https://developer.android.com/reference/androidx/wear/tiles/TileBuilders.Tile.Builder#setTimeline(androidx.wear.tiles.TimelineBuilders.Timeline))(@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/wear/tiles/TimelineBuilders.Timeline timeline)` **This method is deprecated.** Use `https://developer.android.com/reference/androidx/wear/tiles/TileBuilders.Tile.Builder#setTileTimeline(androidx.wear.protolayout.TimelineBuilders.Timeline)` instead. <br /> |

## Public constructors

### Builder

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

```
@RequiresSchemaVersion(major = 1, minor = 0)
public Builder()
```

Creates an instance of `https://developer.android.com/reference/androidx/wear/tiles/TileBuilders.Tile.Builder`.

## Public methods

### build

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

```
public @NonNull TileBuilders.Tile build()
```

Builds an instance from accumulated values.

### setFreshnessIntervalMillis

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

```
@RequiresSchemaVersion(major = 1, minor = 0)
public @NonNull TileBuilders.Tile.Builder setFreshnessIntervalMillis(long freshnessIntervalMillis)
```

Sets how many milliseconds of elapsed time (\*\*not\*\* wall clock time) this tile can be considered to be "fresh". The platform will attempt to refresh your tile at some point in the future after this interval has lapsed. A value of 0 here signifies that auto-refreshes should not be used (i.e. you will manually request updates via TileService#getRequester).

This mechanism should not be used to update your tile more frequently than once a minute, and the system may throttle your updates if you request updates faster than this interval. This interval is also inexact; the system will generally update your tile if it is on-screen, or about to be on-screen, although this is not guaranteed due to system-level optimizations.

### setResourcesVersion

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

```
@RequiresSchemaVersion(major = 1, minor = 0)
public @NonNull TileBuilders.Tile.Builder setResourcesVersion(@NonNull String resourcesVersion)
```

Sets the resource version required for these tiles. This can be any developer-defined string; it is only used to cache resources, and is passed in `https://developer.android.com/reference/androidx/wear/tiles/RequestBuilders.ResourcesRequest` if the system does not have a copy of the specified resource version.

### setState

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

```
@RequiresSchemaVersion(major = 1, minor = 200)
public @NonNull TileBuilders.Tile.Builder setState(@NonNull StateBuilders.State state)
```

Sets `https://developer.android.com/reference/androidx/wear/protolayout/StateBuilders.State` for this tile.

### setTileTimeline

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

```
@RequiresSchemaVersion(major = 1, minor = 0)
public @NonNull TileBuilders.Tile.Builder setTileTimeline(@NonNull TimelineBuilders.Timeline tileTimeline)
```

Sets the `https://developer.android.com/reference/androidx/wear/protolayout/TimelineBuilders.Timeline` containing the layouts for the tiles to show in the carousel, along with their validity periods.

### setTimeline

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 @NonNull TileBuilders.Tile.Builder [setTimeline](https://developer.android.com/reference/androidx/wear/tiles/TileBuilders.Tile.Builder#setTimeline(androidx.wear.tiles.TimelineBuilders.Timeline))(@NonNull TimelineBuilders.Timeline timeline)
```

> [!CAUTION]
> **This method is deprecated.**   
>
> Use `https://developer.android.com/reference/androidx/wear/tiles/TileBuilders.Tile.Builder#setTileTimeline(androidx.wear.protolayout.TimelineBuilders.Timeline)` instead.

Sets the `https://developer.android.com/reference/androidx/wear/tiles/TimelineBuilders.Timeline` containing the layouts for the tiles to show in the carousel, along with their validity periods.