2 ms·
In web development (I don't know how well this applies to native app development) the way to get around 90% of these worries is feature detection. If touch scre
by _greim_ 13y ago
In web development (I don't know how well this applies to native app development) the way to get around 90% of these worries is feature detection. If touch screen, do such-and-such. If X pixels wide, do such-and-such.
Pixels (CSS, not physical) are especially interesting because they're an angular unit of measure based on the user's expected distance from the screen. Once you start building off that foundation, many device fragmentation woes go away.
That said, there are a handful of places where we logic-branch based on API version by reading the UA string. These are usually due to features that report working, but fail miserably.
- jordanthoms 13y agoAndroid has the same thing, but it makes much more sense - Android has 3 length units: density independent pixels, scale independent pixels (which are used for fonts, so the user can have a 'huge font' option), and screen pixels. So you can size things in dp, and they will look a similar size on things with different densities. This was built into android from the beginning.
- randallu 13y agoI'd love to have screen pixels in CSS for doing hairlines. I hate when something that should be a hairline comes out fuzzy or lumpy.