tags:

views:

411

answers:

2

I have a mobile-optimized site that uses a pretty simple trick of serving a different page based on browser width. This worked great until the Droid came along, with its very high pixel density screen.

I understand that the default setting of the screen is 800 pixels wide (significantly wider than my width detect script, which is making its decision of which page to serve at 500 pixels). However, the Droid browser seems to arbitrarily decide to report a smaller width, and thusly serve the smaller-width page. But not in a predictable manor.

As a result, the experience for an end user is completely random: sometimes they see a wide page they have to zoom in on, sometimes they see a page that's scaled just right to their window.

I have written a small script that reports the screen width and, even when forcing the viewport to a specific pixel size, I have had some users still report an 800 pixel width (even in vert orientation) and others report the fixed width.

Is there a way of definitively setting the width for the Droid's browser? Is this a bug? Am I just simply not thinking something through? Frankly, it's starting to feel like designing in a dark cave with my hands tied behind my back.

A: 

Very nice website, Dan. Congratulations. I am also having serious trouble with the Droid. It has become so bad that I am dropping support for it at this stage for my main app (I did manage to get the other two to work there). This is not the first problem I hear about the Droid, and I do not know when they will fix it. In your case it could be a Droid bug, with nothing wrong on your side. I am sorry I cannot give you a solution, but at least you know you are not alone. Regards, Ari

BeMeCollective
Can you explain what problems you've been having with the Droid? Are they similar to my own--are you doing a browser-based site as well?
Dan Sinker
Hi Dan,No, in my case it's an app, not a browser. But I encountered layout problems. 1. The fonts don't behave according to documentation, eventhough all is OK in the simulator. 2. I need to use the method "getSurface", but I can't get it to work on the Droid. Regards, Ari.
BeMeCollective
+1  A: 

It looks like you're determining whether to display the mobile page (the story) or the description page by screen width. From my understanding, it would probably be better to detect mobile phones by user agent or user a pre-built browser detection script to determine which page to display. I often use browser windows less than 800px wide, so an issue like this would have prevented me from seeing the page correctly on my browser.

igul222
Have any recommendations for a pre-built browser detection script?
Dan Sinker