Using Adobe AIR for Android, I’d like to find a way to distinguish a phone from a tablet. The closest I can find is detecting the dpi. (My phone dpi is 254, my tablet is 149) but is that going to be reliable or is there a better way?
(I’ve been using stackoverflow for a while but this is my first post – yippee!!)
Absolutely not. A T-Mobile G1 would be a tablet by that measure.
Frankly, you should not be caring whether an Android device is a telephone, tablet, television, toaster, telescope, or toilet.
You should be caring about characteristics and capabilities.
For example, if you are thinking about tablets in terms of screen size, use
<supports-screens>and the-largeand-xlargeresource sets (e.g.,res/layout/for normal stuff andres/layout-large/for larger screen sizes).Or, if you are thinking about tablets in terms of whether or not you can place a phone call, use
<uses-feature>andhasSystemFeature()onPackageManager.