Webdevtoolsonline.com Home About Contact
Google

How to detect the brand and model of a mobile phone.

Part 1: Introduction

 

Why!?

The reasons why one might want to detect the brand and model of a mobile phone should be obvious. A lot of companies that offer software for mobile phones have different versions, based on the capabilities and supported technology of the visitors handset. Also for mobile websites it is very handy to have an idea of the capabilities of the visitors browser so they can decide on using wml or (x)html, enabling javascript or on the bitdepth of imagery, the use of tables and so on.

I estimate there's currently (end of 2008) about 2500 different devices in the world, including Symbian and Windows Mobile enabled devices so there's a broad audience to adapt to.

Useragent

One of the most obvious methods is to address a browser's useragent to find some info about the make and model of the device.

Wap Mobile Profile

A more solid approach is to first check if the devices x-wap-profile is set. This header contains a url which points to an xml document on the manufacturers website which contains a wide range of information about capabilities and configuration of the device. Unfortunately this information sometimes contains errors, but if we're focussing on recognising the device we don't really care about most of this info.

For example: "http://nds1.nds.nokia.com/uaprof/N6230r200.xml"

The exceptions

Usually a browser will always send a user-agent in it's http-headers and the more modern devices will also have a x-wap-profile header, but there are some nasty exceptions.

Opera mini

The first one that springs to mind is Opera-mini, a popular browser for mobile phones. This browser works so well because all data is always passed through a proxy that cleans up the html and images to make it's own life easier. They often have a user-agent that reveals nothing about the devices. However they usually do use the device's default user-agent and send it in a special http header you just have to know is there. It is the "X-OperaMini-Phone-UA" header.

A good thing about Opera is that they sometimes are so nice to just send you the brand and model of the phone in a separate header called "X-OperaMini-Phone" which contains the brand/model in a form like this "SonyEricsson # K750i". It doesn't get much easier.

Windows Mobile

The other tricky thing is to recognise Windows Mobile phones and distinguish touchscreen devices from smartphones. I've added a list of links to usefull resources.

Links

Very informative aArticle about Opera mini's http headers.
http://dev.opera.com/articles/view/opera-mini-request-headers/

Heavily needed page that explains more about Internet Explorer's headers.
http://blogs.msdn.com/iemobile/archive/2006/08/03/Detecting_IE_Mobile.aspx

The site if WURFL, a famous Device Description Repository
http://wurfl.sourceforge.net/

 

This website is hosted by Vendite.nl