# DeviceParametersBuilders.DeviceParameters

# DeviceParametersBuilders.DeviceParameters

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)  
Added in[1.0.0](https://developer.android.com/jetpack/androidx/releases/wear-protolayout#1.0.0)

*** ** * ** ***

Kotlin\|[Java](https://developer.android.com/reference/androidx/wear/protolayout/DeviceParametersBuilders.DeviceParameters "View this page in Java")

<br />

```
@RequiresSchemaVersion(major = 1, minor = 0)
class DeviceParametersBuilders.DeviceParameters
```

<br />

*** ** * ** ***

Parameters describing the device requesting a layout update. This contains physical and logical characteristics about the device (e.g. screen size and density, etc).

## Summary

|                                                                                                                                                             ### Nested types                                                                                                                                                              |
|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `class `[DeviceParametersBuilders.DeviceParameters.Builder](https://developer.android.com/reference/kotlin/androidx/wear/protolayout/DeviceParametersBuilders.DeviceParameters.Builder) Builder for[DeviceParameters](https://developer.android.com/reference/kotlin/androidx/wear/protolayout/DeviceParametersBuilders.DeviceParameters) |

|                                                                                                           ### Public functions                                                                                                           |
|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [DeviceParametersBuilders.Capabilities](https://developer.android.com/reference/kotlin/androidx/wear/protolayout/DeviceParametersBuilders.Capabilities)`?`                                                                               | `@`[ProtoLayoutExperimental](https://developer.android.com/reference/kotlin/androidx/wear/protolayout/expression/ProtoLayoutExperimental) [getCapabilities](https://developer.android.com/reference/kotlin/androidx/wear/protolayout/DeviceParametersBuilders.DeviceParameters#getCapabilities())`()` Gets renderer supported[Capabilities](https://developer.android.com/reference/kotlin/androidx/wear/protolayout/DeviceParametersBuilders.Capabilities). |
| [Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)                                                                                                                                                              | [getDevicePlatform](https://developer.android.com/reference/kotlin/androidx/wear/protolayout/DeviceParametersBuilders.DeviceParameters#getDevicePlatform())`()` Gets the platform of the device.                                                                                                                                                                                                                                                             |
| `@`[FloatRange](https://developer.android.com/reference/kotlin/androidx/annotation/FloatRange)`(from = 0.0, fromInclusive = false, toInclusive = false) `[Float](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html) | [getFontScale](https://developer.android.com/reference/kotlin/androidx/wear/protolayout/DeviceParametersBuilders.DeviceParameters#getFontScale())`()` Gets current user preference for the scaling factor for fonts displayed on the display.                                                                                                                                                                                                                |
| [VersionBuilders.VersionInfo](https://developer.android.com/reference/kotlin/androidx/wear/protolayout/expression/VersionBuilders.VersionInfo)                                                                                           | [getRendererSchemaVersion](https://developer.android.com/reference/kotlin/androidx/wear/protolayout/DeviceParametersBuilders.DeviceParameters#getRendererSchemaVersion())`()` Gets the maximum schema version supported by the current renderer.                                                                                                                                                                                                             |
| `@`[FloatRange](https://developer.android.com/reference/kotlin/androidx/annotation/FloatRange)`(from = 0.0, fromInclusive = false, toInclusive = false) `[Float](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html) | [getScreenDensity](https://developer.android.com/reference/kotlin/androidx/wear/protolayout/DeviceParametersBuilders.DeviceParameters#getScreenDensity())`()` Gets density of the display.                                                                                                                                                                                                                                                                   |
| `@`[Dimension](https://developer.android.com/reference/kotlin/androidx/annotation/Dimension)`(unit = 0) `[Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)                                                     | [getScreenHeightDp](https://developer.android.com/reference/kotlin/androidx/wear/protolayout/DeviceParametersBuilders.DeviceParameters#getScreenHeightDp())`()` Gets height of the device's screen in DP.                                                                                                                                                                                                                                                    |
| [Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)                                                                                                                                                              | [getScreenShape](https://developer.android.com/reference/kotlin/androidx/wear/protolayout/DeviceParametersBuilders.DeviceParameters#getScreenShape())`()` Gets the shape of the device's screen.                                                                                                                                                                                                                                                             |
| `@`[Dimension](https://developer.android.com/reference/kotlin/androidx/annotation/Dimension)`(unit = 0) `[Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)                                                     | [getScreenWidthDp](https://developer.android.com/reference/kotlin/androidx/wear/protolayout/DeviceParametersBuilders.DeviceParameters#getScreenWidthDp())`()` Gets width of the device's screen in DP.                                                                                                                                                                                                                                                       |
| [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)                                                                                                                                                        | [toString](https://developer.android.com/reference/kotlin/androidx/wear/protolayout/DeviceParametersBuilders.DeviceParameters#toString())`()`                                                                                                                                                                                                                                                                                                                |

## Public functions

### getCapabilities

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

```
@ProtoLayoutExperimental
fun getCapabilities(): DeviceParametersBuilders.Capabilities?
```

Gets renderer supported[Capabilities](https://developer.android.com/reference/kotlin/androidx/wear/protolayout/DeviceParametersBuilders.Capabilities).  

### getDevicePlatform

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

```
fun getDevicePlatform(): Int
```

Gets the platform of the device.  

### getFontScale

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

```
fun getFontScale(): @FloatRange(from = 0.0, fromInclusive = false, toInclusive = false) Float
```

Gets 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).  

### getRendererSchemaVersion

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

```
fun getRendererSchemaVersion(): VersionBuilders.VersionInfo
```

Gets 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.  

### getScreenDensity

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

```
fun getScreenDensity(): @FloatRange(from = 0.0, fromInclusive = false, toInclusive = false) Float
```

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

### getScreenHeightDp

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

```
fun getScreenHeightDp(): @Dimension(unit = 0) Int
```

Gets height of the device's screen in DP.  

### getScreenShape

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

```
fun getScreenShape(): Int
```

Gets the shape of the device's screen.  

### getScreenWidthDp

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

```
fun getScreenWidthDp(): @Dimension(unit = 0) Int
```

Gets width of the device's screen in DP.  

### toString

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