# DeviceParametersBuilders.DeviceParameters.Builder

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

*** ** * ** ***


```
public final class DeviceParametersBuilders.DeviceParameters.Builder
```

<br />

*** ** * ** ***

Builder for `https://developer.android.com/reference/androidx/wear/protolayout/DeviceParametersBuilders.DeviceParameters`

## Summary

| ### Public constructors |
|---|
| `https://developer.android.com/reference/androidx/wear/protolayout/DeviceParametersBuilders.DeviceParameters.Builder#Builder()()` Creates an instance of `https://developer.android.com/reference/androidx/wear/protolayout/DeviceParametersBuilders.DeviceParameters.Builder`. |

| ### Public methods |
|---|---|
| `@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/protolayout/DeviceParametersBuilders.DeviceParameters.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/protolayout/DeviceParametersBuilders.DeviceParameters.Builder` | `@https://developer.android.com/reference/androidx/wear/protolayout/expression/RequiresSchemaVersion(major = 1, minor = 200) @https://developer.android.com/reference/androidx/wear/protolayout/expression/ProtoLayoutExperimental https://developer.android.com/reference/androidx/wear/protolayout/DeviceParametersBuilders.DeviceParameters.Builder#setCapabilities(androidx.wear.protolayout.DeviceParametersBuilders.Capabilities)( @https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/wear/protolayout/DeviceParametersBuilders.Capabilities capabilities )` Sets renderer supported `https://developer.android.com/reference/androidx/wear/protolayout/DeviceParametersBuilders.Capabilities`. |
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/wear/protolayout/DeviceParametersBuilders.DeviceParameters.Builder` | `@https://developer.android.com/reference/androidx/wear/protolayout/expression/RequiresSchemaVersion(major = 1, minor = 0) https://developer.android.com/reference/androidx/wear/protolayout/DeviceParametersBuilders.DeviceParameters.Builder#setDevicePlatform(int)(int devicePlatform)` Sets the platform of the device. |
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/wear/protolayout/DeviceParametersBuilders.DeviceParameters.Builder` | `@https://developer.android.com/reference/androidx/wear/protolayout/expression/RequiresSchemaVersion(major = 1, minor = 200) https://developer.android.com/reference/androidx/wear/protolayout/DeviceParametersBuilders.DeviceParameters.Builder#setFontScale(float)( @https://developer.android.com/reference/androidx/annotation/FloatRange(from = 0.0, fromInclusive = false, toInclusive = false) float fontScale )` Sets current user preference for the scaling factor for fonts displayed on the display. |
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/wear/protolayout/DeviceParametersBuilders.DeviceParameters.Builder` | `@https://developer.android.com/reference/androidx/wear/protolayout/expression/RequiresSchemaVersion(major = 1, minor = 0) https://developer.android.com/reference/androidx/wear/protolayout/DeviceParametersBuilders.DeviceParameters.Builder#setRendererSchemaVersion(androidx.wear.protolayout.expression.VersionBuilders.VersionInfo)( @https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/wear/protolayout/expression/VersionBuilders.VersionInfo rendererSchemaVersion )` Sets the maximum schema version supported by the current renderer. |
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/wear/protolayout/DeviceParametersBuilders.DeviceParameters.Builder` | `@https://developer.android.com/reference/androidx/wear/protolayout/expression/RequiresSchemaVersion(major = 1, minor = 0) https://developer.android.com/reference/androidx/wear/protolayout/DeviceParametersBuilders.DeviceParameters.Builder#setScreenDensity(float)( @https://developer.android.com/reference/androidx/annotation/FloatRange(from = 0.0, fromInclusive = false, toInclusive = false) float screenDensity )` Sets density of the display. |
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/wear/protolayout/DeviceParametersBuilders.DeviceParameters.Builder` | `@https://developer.android.com/reference/androidx/wear/protolayout/expression/RequiresSchemaVersion(major = 1, minor = 0) https://developer.android.com/reference/androidx/wear/protolayout/DeviceParametersBuilders.DeviceParameters.Builder#setScreenHeightDp(int)(@https://developer.android.com/reference/androidx/annotation/Dimension(unit = 0) int screenHeightDp)` Sets height of the device's screen in DP. |
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/wear/protolayout/DeviceParametersBuilders.DeviceParameters.Builder` | `@https://developer.android.com/reference/androidx/wear/protolayout/expression/RequiresSchemaVersion(major = 1, minor = 0) https://developer.android.com/reference/androidx/wear/protolayout/DeviceParametersBuilders.DeviceParameters.Builder#setScreenShape(int)(int screenShape)` Sets the shape of the device's screen. |
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/wear/protolayout/DeviceParametersBuilders.DeviceParameters.Builder` | `@https://developer.android.com/reference/androidx/wear/protolayout/expression/RequiresSchemaVersion(major = 1, minor = 0) https://developer.android.com/reference/androidx/wear/protolayout/DeviceParametersBuilders.DeviceParameters.Builder#setScreenWidthDp(int)(@https://developer.android.com/reference/androidx/annotation/Dimension(unit = 0) int screenWidthDp)` Sets width of the device's screen in DP. |

## Public constructors

### Builder

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

```
public Builder()
```

Creates an instance of `https://developer.android.com/reference/androidx/wear/protolayout/DeviceParametersBuilders.DeviceParameters.Builder`.

## Public methods

### build

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

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

Builds an instance from accumulated values.

### setCapabilities

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

```
@RequiresSchemaVersion(major = 1, minor = 200)
@ProtoLayoutExperimental
public @NonNull DeviceParametersBuilders.DeviceParameters.Builder setCapabilities(
    @NonNull DeviceParametersBuilders.Capabilities capabilities
)
```

Sets renderer supported `https://developer.android.com/reference/androidx/wear/protolayout/DeviceParametersBuilders.Capabilities`.

### setDevicePlatform

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

```
@RequiresSchemaVersion(major = 1, minor = 0)
public @NonNull DeviceParametersBuilders.DeviceParameters.Builder setDevicePlatform(int devicePlatform)
```

Sets the platform of the device.

### setFontScale

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

```
@RequiresSchemaVersion(major = 1, minor = 200)
public @NonNull DeviceParametersBuilders.DeviceParameters.Builder setFontScale(
    @FloatRange(from = 0.0, fromInclusive = false, toInclusive = false) float fontScale
)
```

Sets current user preference for the scaling factor for fonts displayed on the display. This value is used to get from SP to DP (dp = sp \* font_scale).

### setRendererSchemaVersion

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

```
@RequiresSchemaVersion(major = 1, minor = 0)
public @NonNull DeviceParametersBuilders.DeviceParameters.Builder setRendererSchemaVersion(
    @NonNull VersionBuilders.VersionInfo rendererSchemaVersion
)
```

Sets the maximum schema version supported by the current renderer. When building a layout that uses features not available on schema version 1.0 , this can be used to conditionally choose which feature to use.

### setScreenDensity

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

```
@RequiresSchemaVersion(major = 1, minor = 0)
public @NonNull DeviceParametersBuilders.DeviceParameters.Builder setScreenDensity(
    @FloatRange(from = 0.0, fromInclusive = false, toInclusive = false) float screenDensity
)
```

Sets density of the display. This value is the scaling factor to get from DP to Pixels (px = dp \* density).

### setScreenHeightDp

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

```
@RequiresSchemaVersion(major = 1, minor = 0)
public @NonNull DeviceParametersBuilders.DeviceParameters.Builder setScreenHeightDp(@Dimension(unit = 0) int screenHeightDp)
```

Sets height of the device's screen in DP.

### setScreenShape

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

```
@RequiresSchemaVersion(major = 1, minor = 0)
public @NonNull DeviceParametersBuilders.DeviceParameters.Builder setScreenShape(int screenShape)
```

Sets the shape of the device's screen.

### setScreenWidthDp

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

```
@RequiresSchemaVersion(major = 1, minor = 0)
public @NonNull DeviceParametersBuilders.DeviceParameters.Builder setScreenWidthDp(@Dimension(unit = 0) int screenWidthDp)
```

Sets width of the device's screen in DP.