Differentiating between a small or a large screen (with similar screen resolution)

I would like to optimize my app so that the screen layout is different if it runs on a phone or a tablet. However, Android phones and tablets can sometimes have similar screen resolutions.

For example,
- Galaxy Nexus has 4.65" 1280 x 720 screen
- Galaxy Tab 10.1 has 10.1" 1280 x 800 screen
so using display.contentScaleX would return almost the same number for both devices.

The ideal would be to be able to detect the difference within config.lua (as is done for iPhone vs. iPad), but the problem is that system.getInfo("model") returns the specific model name of that device and unless I code all the possible Android device names, I can't see how to differentiate between phone and tablet.

Does anyone have any suggestions?

I've been thinking about this myself for some time. Corona doesn't have any way to return the actual screen size so we can't implement any type of logic for that. The only way to this right now is, like you said, to keep a table with a list of devices and their physical size, dpi, etc. Then make a function that reads the device model info, looks it up on the table and converts the information to some predefined value according to the screen size:
- small
- medium
- large
Probably not what you wanted, but so far it's the only option if you are really committed to providing the best user experience.

views:1682 update:2012/1/4 9:12:54
corona forums © 2003-2011