I noticed a few problems getting screen.width and screen.height on Android 4.2.
- Dimensions are not updated to reflect device orientation.
You can fix this if you want by first getting the orientation, then changing the values accordingly.
http://menacingcloud.com/?c=orientationScreenWidth
http://davidwalsh.name/orientation-change (nice use of matchMedia)
- OS user interface elements are subtracted from the actual device screen sizes.
eg. Nexus 7 - 1280x800, reports 1205x800. 75px for OS buttons.
- Ideally (in my opinion), the values should be in CSS pixels, not in the device pixels.
eg. nexus 7, the CSS viewport is set to 600 pixels in the portrait, but screen.width reports 800px. So the DPR is about 1.33
In general, screen.width and screen.height are not very reliable (iOS also has orientation problems).
I hope that in the near future I will edit this answer in more detail.
source share