0

So, as far as I know, we can use next formula:
density = SQRT(width*width+height*height)/screen_size.

For example, Nexus 6 (6.0", 1_440*2_560) should give 490 dpi (approx.), but Android Studio Preview screen shows this device with 560 dpi.

What am I missing?

Goltsev Eugene
  • 3,325
  • 6
  • 25
  • 48
  • 1
    http://stackoverflow.com/q/28477572/794088 & http://stackoverflow.com/questions/30041594/how-does-quantized-density-affect-image-resource-selection-and-scaling – petey Apr 26 '16 at 16:16

2 Answers2

3

Although each device has its own screen density, Android includes the device into the nearest density "bucket":

  • 420 dpi
  • 560 dpi
  • xhdpi
  • xxhdpi

As seen in Android Studio:

enter image description here

Although the Nexus 6 and 6P have different physical screen densities, the same drawable resource will be used for both devices.

AgileNinja
  • 914
  • 1
  • 7
  • 20
1

About the Nexus 6, the manufacturer density is 560 but the physical density is about 493. Always think about the manufacturer density before think scale factor.

josedlujan
  • 5,357
  • 2
  • 27
  • 49