First, the “androidDisplayApproximateDpi” property does not return the screen’s actual DPI. If you look at our documentation (link below), it returns the hard coded DPI constant values of Google’s mdpi, hdpi, xhdpi xxhdpi, etc. screen designators. These are set by the device manufacture and are expected to be *close* to the screen’s DPI.
https://docs.coronalabs.com/daily/api/library/system/getInfo.html#androiddisplayapproximatedpi
And you can use the above approximate DPI to determine what the Android device’s recommended native scale factor should be. Or really how to convert pixels to Andorid’s “dp” (Device-independent pixel) coordiantes, which is kind of the equivalent to Apple native point system. On Android, you would calculate it via the following pseudo code…
androidScale = androidApproximateDpi / mdpi
…which in Lua would look like this…
local androidScale = system.getInfo(“androidDisplayApproximateDpi”) / 160
Note that Android documents what these mdpi/hdpi/etc. values are here…
http://developer.android.com/guide/practices/screens_support.html#range
http://developer.android.com/reference/android/util/DisplayMetrics.html
So, as you can see above, this property really is an Android exclusive feature.
Now if what you are really after is the screen actual DPI (not the approximate DPI), then unfortunately there is no 100% reliable way of doing this. While Android does have APIs for fetching this (Corona exposes these via “androidDisplayXDpi” and “androidDisplayYDpi”), some Android device manufacturers actually return the wrong value. Again, making it unreliable. And last I’ve checked, iOS does not provide an API for fetching the screen’s DPI, forcing you to assume the screen’s DPI based on the running device model, which is not future proof.
So, there you go. That’s the reason why. Nothing is ever easy, eh?