For example in my Flex Mobile AIR app, if I wanted to change the position of some components or like make a more android tablet like menu. How can i detect if the user is on a tablet so i can do this? Thanks!
just like a simple thing like this:
if(on a tablet)
{
}
else
{
}
I think i remember seeing an article on this…but I can’t seem to find it.
|||
You can’t specifically read “tablet”, but you can assume one based on values found in the
such as:
Capabilities.screenDPI
Capabilities.screenResolutionX
Capabilities.screenResolutionY
Note that capabilities.screenDPI might be different than the DPI found in the server string.
Here is a blog post on the subject
http://renaun.com/blog/2011/01/air-capabilities-screendpi-on-devices/
Example on my phone:
Capabilities.screenResolutionY=848
Capabilities.screenDPI=240
assuming its correct and the screen is 240 pixels per inch…
(848/240 = 3.52 inches)
Although this is not 100% accurate to my device, I can guess its a phone rather than a tablet.
A Native extension with Air 3 can probably pull more detail on the device.
Related posts:
- Photoshop Elements 7 and tablet
- validate phone
- opening links and attachements on a tablet?
- Need Recommendation On First Drawing Tablet (PC)
- Make phone call from mobile app
Related posts brought to you by Yet Another Related Posts Plugin.