Retina scale factor versus display metrics

Thomas McGrath III 3mcgrath at
Fri Oct 26 12:21:54 EDT 2012

I don't have any Android devices to test with and I am wondering how to deal with Retina scale factor versus display metrics for Android development. 

I thought that display metrics where just the categories that different physically sized Android devices fit into and not the actual doubling of pixels like with retina displays. I thought I heard of other phones that have retina like displays at different scales (1.5) I believe but this display metric seems different than that.

Also, what does the Display Metrics return? The docs mention absolutely nothing. I looked Display Metrics up on the internet and got all kinds of different approaches and results for this like DisplayMetrics.DENSITY_LOW and ldli and display independent pixels versus actual pixels and in Livecode we have one logical 'point' mapped to two physical 'pixels' which don't reference dpi at all.

 The best I found is this:

DisplayMetrics.density is the "logical density of the display", i.e. a value of 0.75 (ldpi), 1.0 (mdpi), 1.5 (hdpi) or 2.0 (xhdpi). Multiply this value by 160 to get the "screen density expressed as dots-per-inch", i.e. a value of 120 (ldpi), 160 (mdpi), 240 (hdpi) or 320 (xhdpi).

But this can't be used as a multiplier of pixels like the retina result, or can it? And if so, are there really that many retina/pixel doubled displays out there?

I double the size of my standard livecode controls to get a retina pixel so should I be multiplying the density result to get a true scale for standard livecode controls? Is this the size and width, height of a device or the virtual screen size of a devices retina or not screen?



Thomas J McGrath III
3mcgrath at

Lazy River Software

More information about the Use-livecode mailing list