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/

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>