It's an odd behaviour of Android 2.3. which i found out here: http://tripleodeon.com/2011/12/first-understand-your-screen
Android v2.3, in a regular browser scenario, however, displays even more curious behavior. Its screen.width always starts off as 800 – which is clearly some sort of virtual viewport, rather than the physical screen. But when the document has an XHTML-MP doctype, or a constrained viewport (for any doctype), the value will switch, by the time of the document load event, to be the 320 or 480 you might expect.
window.outerWidth should do the trick or set viewport width to device-width
<meta name="viewport" content="width=device-width, user-scalable=no" />