title: Getting correct device display width for Android (Nexus 7 Tablet) with Javascript
body: <p>screen.width and .height should contain the screen resolution of a tablet in device pixels and should change when the orientation of the device changes (for reference, see  <a href="http://www.quirksmode.org/mobile/tableViewport.html" rel="nofollow">http://www.quirksmode.org/mobile/tableViewport.html</a>).  However, for the Nexus 7 Android tablet, these values are always screen.width = 1280 and screen.height = 736, regardless of the orientation.  The height of 736 allows for a 64 pixel status bar (actual screen height = 800 pixels).</p>
  
  <p>It's easy enought to flip these values in portrait mode (window.orientation=== 0 || window.orientation=== 180), which gives width 736 and height 1280, but since the status bar stays at top, the correct values should be 800 x 1216.</p>
  
  <p>Is there a generalized/best practice approach to getting the screen width in device pixels on Android devices such as the Nexus 7?  I'm aware of window.outerWidth, but have noticed it is sometimes incorrect.  Is the failure to swap the width and height when the orientation changes common to all Android devices?</p>