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

Capabilities class

 

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:

  1. Photoshop Elements 7 and tablet
  2. validate phone
  3. opening links and attachements on a tablet?
  4. Need Recommendation On First Drawing Tablet (PC)
  5. Make phone call from mobile app

Related posts brought to you by Yet Another Related Posts Plugin.

 Leave a Reply

(required)

(required)

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

   
© 2012 free icons download Suffusion theme by Sayontan Sinha

Featuring Recent Posts WordPress Widget development by YD