Skip to main content
October 22, 2011
Question

phone or tablet?

  • October 22, 2011
  • 1 reply
  • 348 views

Hi, for some apps we may need to tell if the device running it is a phone or a tablet due to layout changes that we may apply on it. Until now a somehow safe method I used was checking for stage size. If width or height were above 1000 pixels I could tell the app is running on a tablet. However, now we have been presented with high res phones, like the Galaxy Nexus, and this method can no longer be used... Is there a way to know if the device is a tablet or phone?

This topic has been closed for replies.

1 reply

Participating Frequently
October 22, 2011

For layout changes, it isn't phone vs tablet that is important; it is physical screen size, correct? Instead of just looking at pixels, look at pixels/dpi. Use Capabilities.screenDPI.