Each Android device has a physical pixel density and a \'quantized density\'. Sources state that the quantized density is the one used to determine how drawable-dpi images a
For the scaling part of the question, first get the quantized density for the device by running
adb shell getprop ro.sf.lcd_density
and call this the quantized density for the device. In general this quantized density differs from the physical density of the device but it can be the same if the physical density falls perfectly as one of the dpi 'bucket' boundaries. Whereas the physical density describes a real-world measurement, the quantized density is set by the device manufacturer, and is usually chosen to be one of the following values:
Quantized density controls what I will call the Image Scaling Factor (ISF) for the device. The formula is as follows:
ISF = ro.sf.lcd_density / 160
The ISF is the scale factor that is used when Android's resource-loading/layout-manager reads a resource bitmap from a file and renders it to the screen (I don't know if the scaling happens at load-time or render-time). On the Nexus 6 device, the ISF is 3.5 because the quantized density was set to be 560 (and 560 / 160 = 3.5). To be sure, the rendered size at runtime is also a function of the drawable bucket that contains the file in question. For example, on the Nexus 6:
Incidentally, the quantized density also defines the physical size of the dp that you specify in your layout files. The formula for this is:
+=======================+
| Dq |
| 1dp = ----- px |
| 160 |
+=======================+
where Dq is the quantized density. For example,