Android Dev Summit, October 23-24: two days of technical content, directly from the Android team. Sign-up for livestream updates.

ConfigurationHelper

class ConfigurationHelper
kotlin.Any
   ↳ androidx.core.content.res.ConfigurationHelper

Helper class which allows access to properties of Configuration in a backward compatible fashion.

Summary

Public methods

static Int
getDensityDpi(@NonNull resources: Resources)

Returns the target screen density being rendered to.

Public methods

getDensityDpi

static fun getDensityDpi(@NonNull resources: Resources): Int

Returns the target screen density being rendered to.

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