Android 2.3 web-browser width

The web-browser in android render pages in 320 or 800 pixels, and doesn’t seem to be consequent about it. This is because of “viewport”, rendering pages in a virtual screen with larger width then the mobile screen has. Viewport makes sure rendering of non-mobile-sites doesn’t break.

JavaScript(requires jQuery) to check width:

$("document").ready(function($){
  $('p.width').append($(window).width());
  $('p.height').append($(window).height());
});

Add this meta tag to always render in mobile native resolution:


Further reading:
http://developer.android.com/guide/webapps/targeting.html
http://tripleodeon.com/2011/12/first-understand-your-screen/