# ConfigurationHelper

# ConfigurationHelper

Artifact:[androidx.core:core](https://developer.android.com/jetpack/androidx/releases/core)  
[View Source](https://cs.android.com/search?q=file:androidx/core/content/res/ConfigurationHelper.java+class:androidx.core.content.res.ConfigurationHelper)  
Added in[1.1.0](https://developer.android.com/jetpack/androidx/releases/core#1.1.0)

*** ** * ** ***

Kotlin\|[Java](https://developer.android.com/reference/androidx/core/content/res/ConfigurationHelper "View this page in Java")

<br />

```
class ConfigurationHelper
```

<br />

*** ** * ** ***

Helper class which allows access to properties of[Configuration](https://developer.android.com/reference/android/content/res/Configuration.html)in a backward compatible fashion.

## Summary

|                                   ### Public functions                                    |
|-------------------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `java-static `[Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html) | [getDensityDpi](https://developer.android.com/reference/kotlin/androidx/core/content/res/ConfigurationHelper#getDensityDpi(android.content.res.Resources))`(resources: `[Resources](https://developer.android.com/reference/android/content/res/Resources.html)`)` Returns the target screen density being rendered to. |

## Public functions

### getDensityDpi

Added in[1.1.0](https://developer.android.com/jetpack/androidx/releases/core#1.1.0)  

```
java-static fun getDensityDpi(resources: Resources): Int
```

Returns the target screen density being rendered to.

Uses`Configuration.densityDpi`when available, otherwise an approximation is computed and returned.