media query feature has led to many interesting possibilities in terms of developing websites which adjust to many different screen sizes and devices.
However, in practice, I'm starting to get the sense that the CSS3
media query feature, and the whole "Responsive Web Design" movement, may not live up to its promise.
The problem I see is that, at the end of the day, web developers care mostly about whether their users are viewing content via a Desktop, Tablet, or Mobile device. But CSS3 only provides a means to detect screen resolution. In theory, detecting screen resolution seems like a great way to adjust for various different devices. But in practice...
On my Blackberry Touch, this outputs:
On my Samsung Galaxy, this outputs:
So...um, at this point, the resolution of mainstream smart phones is getting pretty close to Desktop-level resolutions. The ability to detect whether a user is viewing your website via a smartphone, tablet, or desktop, seems to be increasingly difficult if all you're going by is screen resolution.
This makes me call into question the entire wisdom behind the whole CSS3 "Responsive Web Design" movement based on media queries. It almost seems like the
media query feature is better suited towards adapting to a resizing browser window on a Desktop screen, rather than various mobile devices.
Another possible technique for detecting mobile or tablet devices is to use feature detection, by checking if the
ontouchstart event is supported. But even this is becoming increasing unreliable as many Desktop screens start to support touch.
Question: So... as a web developer, if I can't rely on RWD or feature detection, is user-agent sniffing (as notoriously unreliable as always) really the best option to detect mobile devices?