I am trying to create a 4K emulator in Android Studio like in the screenshot below
According to the configuration displayed, the resolution should be 3840x2160
and the density xxxhdpi which is 640
, however, I have an app where I try to get resolution and density and present it on the screen.
The code is:
Column(
modifier = Modifier.align(Alignment.BottomCenter)
) {
val screenDensity: Float = LocalContext.current.resources.displayMetrics.densityDpi.toFloat()
Text(
color = ColorTokens.white,
text = "screenDensity: $screenDensity"
)
Text(
color = ColorTokens.white,
text = "height: ${LocalContext.current.resources.displayMetrics.heightPixels}"
)
Text(
color = ColorTokens.white,
text = "width: ${LocalContext.current.resources.displayMetrics.widthPixels}"
)
}
The question is – what am I missing here – why 4k emulator has been created, but, it has a completely different configuration?
UPD
Emulator runs on UpsideDownCake API 34
4