• About Us
  • Blog
  • Basket
  • Account
  • Sign In


Published on Friday, May 17, 2013

How to differentiate between different types of Android devices

Developing websites to accommodate for mobile devices has now become standard practice. However, what happens when developers need to determine between different mobile devices (tablets, smartphones, e-readers, games consoles etc)?

We are often asked; how can developers differentiate between two separate Android device types using just their user agent?

Let’s take the example of trying to differentiate between the Samsung Galaxy s3 and the Samsung Galaxy tab 2 10.1.

Device User Agent
Mozilla/5.0 (Linux; U; Android 4.0.4; en-gb; GT-I9300 Build/IMM76D) AppleWebKit/534.30 (KHTML, like Gecko) Version/4.0 Mobile Safari/534.30

Mozilla/5.0 (Linux; U; Android 4.0; xx-xx; GT-P5100 Build/IML74K) AppleWebKit/534.30 (KHTML, like Gecko) Version/4.0 Safari/534.30

The above table shows each devices user agent string. Developers can use Regex to search the user agent string to help define mobile devices. In the above example, if we searched the user agent string for “Android” we would be able to determine that the device is using the Android platform. If we wanted to tell if the device was a tablet we would have to look at the model number in the user agent.

A developer would have to build a rule to define user agents which contain “GT-P5100” as a tablet because the user agent doesn't give any other information to be able to determine the associated device is a tablet. Such an approach is highly impractical given the very large range of Android devices.

51degrees.mobi solves this problem by maintaining an up-to-date device database. Our data team map the user agents to unique device profiles freeing customers from the burden of maintaining complex regular expression.  The device database allows developers to easily differentiate between device types, screen sizes, input methods, software capabilities and many more device properties.

51Degrees.mobi Premium device data is updated weekly, 99.9% accurate, has over 20,000 device combinations and can detect up to 5,000,000 devices per second. 

Comments (0)

Author: Anonym

Categories: Development

Tags: Device Detection , Android , Device Data



.NET 4G 51Degrees 5G Acer Adform Adtech Advertising Afilias Alcatel Amazon AMP Analysis Analytics Android Apache API Apple Asian Market ASP.NET Asus Blackberry Browser C C# Centro Chrome chromium Client hints Cloud CMS CPU CSS3 Data Data Blog Data File Daydream Design Detection Developers Device Device Data Device Detection Device Intelligence Device Models Device property DeviceAtlas Disney dmexco DotNetNuke Download ebay Ericsson Event Facebook Firefox Foundation Framework Galaxy git repositories Google Google Analytics Google Daydream GPU GSMA Guess HAProxy Hash Trie HTC HTML5 HTTP HTTP Headers Huawei Infinix Ingeniux Internet usage iOS iOS 13 ipad iPadOS iPhone iPhone 11 Java Javascript Kentico LG Liferay LTE m.dot Memory Memory leak Meta Data Microsoft Mobile Mobile Analysis Mobile Analytics Mobile Devices Mobile Marketing Mixer Motorola Mozilla MWC MWC 2017 MWC16 Native Apps NET New Release News Nexus NFC NGINX Nokia OnePlus 5 Opera Operating System Oppo Optimisation OS Patent Performance PHP Press Release Price Band programmatic Publishers Python Redirection Research Responsive Images Responsive web design RESS Review RTB RWD Safari Samsung Scala ScientiaMobile SEO Server Server-side optimisation Seznam.cz Sitecore Smart TV Smartphone Smartwatches Sony Swedish Beers Tablet Tencent Testing Tips Tutorial Umbraco Update User Agent User-Agent Valgrind Varnish Varnish Cache Video Vodafone VoLTE Web Web Apps Web content management Webtrekk White Paper Widgets WiFi Windows WURFL Xiaomi Xperia ZTE