Many years ago (pre-smartphone), there was a Java library, written by an Italian chap, that did pretty much the same thing. Don’t remember the name. This appears to use the same approach. I think they had a PHP version, but that was a long time ago. I know it was several megabytes, which was <i>huge</i>, in those days.<p>Did what it said on the tin, but did so, by maintaining a huge list of individual devices and their characteristics. At the time, I chose not to use it (I was developing a <i>[c]</i>WAP server), but it had a number of supporters, and its maintainer was pretty sharp, and quite dedicated.<p>These days, there’s an order of magnitude more devices, and a much greater variety. Big job.