AIR Capabilities.screenDPI on Devices

NOTE: Some of the values have changed in AIR 2.6 see the latest post here.

The relationship between the screen resolution and physical size of the device is very important to know when building multi-screen applications. The AIR and Flash Player runtimes provide information about the hardware capabilities through a set of APIs. The sad news is the current state of this information is somewhat dependent on the OS providing correct information, or at least it is not consistent across devices. I have confirmed that even with native Java applications on Android the screen DPI (or PPI) is not correctly provided. This seems to be a bug starting at the different OS implementations, but I wanted to give a current snapshot of the situation and gather more information. The data below will show the inconsistencies and hopefully enough information to still make decent decisions about physical screen size.

I am going to provide real world data from devices and am looking for more people to provide device information comparing two specific values from the Capabilities class. What I have done is compared the Capabilities.screenDPI and Capabilities.serverString‘s DP value across a half dozen devices that I have.

Device Capabilities.screenDPI Capabilities.serverString’s &DP Actual PPI
Android Nexus 1 254 254 254
Droid Incredible 254 254 254
Droid X 240 144 228
Droid 2 240 144 265
Samsung Galaxy Tab 240 168 168
iPhone 3GS 163 72 163
iPad 132 72 132

NOTE: For iOS devices the latest Packager for iPhone available on labs.adobe.com was used. The rest use the latest AIR 2.5 release.

From the data above the only devices where it will be hard to get any valuable information from is the Droid 2 and X devices. For some reason they both provide 240 and 144 values but are clearly different actual PPI’s on those two devices.

If you have other devices not in my list with AIR installed on the device and you please post the values for Capabilities.screenDPI and Capabilities.serverString in the comments.

  • http://savagelook.com/blog Tony Lukasavage

    Very good information to know. I was very excited when all this multiscreen tech came out, especially when I saw the iReverse demos. Seems like there’s a few more hurdles every day though. I’m not saying I’m not going to pursue it, just that it isn’t going to be quite as simple as I once thought.

  • http://www.renaun.com Renaun Erickson

    Yes, with all the hype across all the devices and available tech, be it Flash/AIR or other technologies, there is a bit of real world growing pains. Things will get better as the tech and devices progress but for now its part of the learning curve.

  • http://blog.yoz.sk Jozef Chutka

    based on DPI you can guess screen size, 1 cm in pixels, 1 inch in pixels etc…
    http://blog.yoz.sk/2010/12/quick-tip-systemscreen-class/

  • http://www.renaun.com Renaun Erickson

    The issue is the screenDPI value is not always correct. And what you are seeing in your post is that desktop’s always provide 72 dpi (event though Mac is 72 and Windows is 96). The 72 dpi comes from the old PC and print world. So even though you might have a 1920×1200 resolution on your PC on a 32in monitor or a 24in monitor the Desktop’s always still show 72 dpi, where the actual Pixels Per Inch is quite different from 32in to 24in. On devices the DPI value was suppose to become a valid number to be able to use but seems to have some quirks at the moment.

  • http://www.adrianparr.com/?p=141 Adrian Parr’s Blog » Blog Archive » Test for Capabilities.screenDPI

    [...] article he mentions using the AS3 Capabilities class and the method screenDPI, however as Renaun Erickson pointed out yesterday there is a problem with the returned value from this method when using AIR on [...]

  • http://himco.jp/air-for-android/?p=2686 AIR Android??????Flash, Flex Hero | 2-38-1:??????????????

    [...] (11/3/1???Galaxy Tab?DPI?240 -> 168?Android?????????tDpiInfo?????????240dpi???????????AIR?Capabilities.screenDPI?168?????????Android OS????????????[AIR Capabilities.screenDPI on Devices]????168????????) [...]

  • http://renaun.com/blog/2011/03/air-2-6-capabilities-screendpi-on-devices/ @renaun posts: AIR 2.6 Capabilities.screenDPI on Devices

    [...] had previously posted on the subtleties of screen PPI on devices here. Since then the AIR runtime is making changes to help where the OS provides the wrong PPI. Its not [...]