It seems there is no real standard for specifying "screen-size" in a http header from a user agent.
For example, the two headers below:
X-UP-devcap-screenpixels: 320x240
or
UA-pixels: 320x240
are two commonly used headers. The second is used by Windows Mobile devices mostly. The X-UP looks like it comes from the UP browser gateway.
Another option is
X-Screen-Width: 320
X-Screen-Height: 240
the X-Screen-Width might be made a up header.
My question is:
What is a good standard to adopt on our "transcoder" going forward? It's not really a full web browser, but is mostly for limited sites. But it should be the standard that would be adopted by Opera Mini/GWT etc.
Neither Opera Mini nor Google Web Transcoder sends this information through in their HTTP requests. I guess they expect the site to look up the phone model, and thereby the screen width and height, on the server side.
I actually found this RFC 4229 called HTTP Header Field Registrations. It's kind of outdated, and a mission to contribute fixes to.
If I had to see what's used mostly in the field, I would probably end up going with "UA-Pixels".
Some more references
It's worse than you think.
UA-pixels: 320x240
Is often a lie. On IEMobile version <8 (Windows Mobile <6.1.4) devices with 640x480 pixels still report themselves as 320x240. In addition, in most versions of IEMobile the view may be zoomed to some extent so that the design size you have to hit is unrelated to the UA-pixels size.
The opportunities for liquid layout are limited prior to IEMobile 8. Yet in IEMobile 8 on WinMobile 6.5 you get about XGA resolution, zoomed out, whether you like it or not. Oh, and there is no way to sniff IEM8-on-6.5 vs. IEM8-on-6.1 from the headers.
I'm not sure what exactly the purpose of your application is, but outputting HTML/CSS that renders exactly to the size of the screen is practically impossible if your targets include the abysmal horror that is IEMobile.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With