I am trying to detect "desktop", "mobile", and "tablet" from user agent strings. What I need is just these three rough categories. Brand and device names are not needed. Some examples of user agent I have are:
"Mozilla/5.0 (compatible; MSIE 10.0; Windows NT 6.1; WOW64; Trident/6.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0; .NET4.0C; .NET4.0E; InfoPath.3)"
"Mozilla/5.0 (Windows NT 5.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/38.0.2125.104 Safari/537.36"
Is there any existing API can do this?
According to the very last sentence of this article, it seems that looking for keyword "mobi" in a user agent string can handle most cases. But it seems too easy to be true......