@slime73, @tangzero any suggestions on how one could create an API for this that is compatible for both iOS and Android?
rename the android module to mobile. Then create subdirs with the specific implemetantion for each plataform.
I think the most important part of the display metrics for use in graphical programs is the expected pixel scale. LÖVE has an API for that with love.window.getPixelScale, so maybe you could make that work properly in Android (similar to how I did it for iOS), and then the rest of the metrics API would probably be unneeded.
Implementation of @tangzero merged in. Defer a common API design to some other time.
Defer a common API design to some other time.
Ah, but that was my point! 0.9.1 (mainline) already has an API which my iOS port takes advantage of, but the Android port doesn't - see love.window.getPixelScale / this commit for iOS.
The implementation in mainline LÖVE only works in OS X right now since SDL for iOS and Android handles DPI a bit differently than it does for OSX, so you'll have to do something similar to my commit for iOS above to make it work properly on Android.
I know and I plan to get it working with your API.