Titanium Community Questions & Answer Archive

We felt that 6+ years of knowledge should not die so this is the Titanium Community Questions & Answer Archive

Getting Mobile Resolution

Is it possible to get the screen resolution of the device? screen.width/height does not work…

Alternatively, how can I differentiate between the iPhone/2G/3G/3GS and the iPhone 4's resolution?

— asked August 11th 2010 by Andrew Munsell
  • iphone
  • resolution
  • screen
0 Comments

1 Answer

  • Accepted Answer

    For resolution try

    Titanium.Platform.displayCaps.platformWidth
    Titanium.Platform.displayCaps.platformHeight
    

    For device detection I think this might help

    Titanium.Platform.model
    

    This should give you some ideas:

    http://github.com/appcelerator/titanium_mobile/blob/master/demos/KitchenSink/Resources/examples/platform.js

    — answered August 11th 2010 by Dan Tamas
    permalink
    0 Comments
The ownership of individual contributions to this community generated content is retained by the authors of their contributions.
All trademarks remain the property of the respective owner.