Thursday, July 20, 2006

[WAP] Detecting Mobile devices on your WAP pages

The first thing you want to do while making a WAP site is to detect the browser that is accessing your site. Knowing the device that is accesing your site can help you determine what content and how this content should be delivered to the requesting browser.

I had been surfing through the web trying to determine the best way to go about detecting the users handset and carrier etc. but did not find a lot of material on this. I have included some of the stuff that works for me.

Determine the carrier:
The best way is to find this out is to look at the
HTTP_VIA header in the request. Most of the requests from handsets come through carrier gateways and that usually would provide you the name of the carrier.
e.g. One of the gateways for Sprint:
"1.1, 1.1 ISA1"

As you can see, a simple search for "sprintspectrum" in the HTTP_VIA header will tell us that the mobile device is from Sprint. Similarly, Cingular devices have "mycingular" in the header.

Determine the handset:
There are 2 ways to go about this, you can either use the User Agent (HTTP_USER_AGENT) or the User Agent Profile (HTTP_PROFILE or HTTP_X_WAP_PROFILE). I prefer parsing the User Agent as it saves time making a request to get the RDF file and parsing the XML returned. However, if you need more information like the color depth, screen width and screen height then the UA profile is the way to go.

Some examples of User Agents are:

- Nokia6230/2.0+(04.43)+Profile/MIDP-2.0+Configuration/CLDC-1.1+UP.Link/
- NokiaN91-1/3.0 ( SymbianOS/9.1 Series60/3.0 Profile/MIDP-2.0 Configuration/CLDC-1.1
-Mozilla/4.0 (compatible; MSIE 5.0; Series80/2.0 Nokia9500/4.51 Profile/MIDP-2.0 Configuration/CLDC-1.1

Sony Ericsson
- SonyEricssonK700i/R2N SEMC-Browser/4.0.1 Profile/MIDP-2.0 Configuration/CLDC-1.1

-MOT-V3i/08.D8.35R MIB/2.2.1 Profile/MIDP-2.0 Configuration/CLDC-1.1
-Motorola-T33/1.5.1a UP.Browser/ (GUI) (Google WAP Proxy/1.0)

-SAMSUNG-SGH-T809/T809UVEJ9 Profile/MIDP-2.0 Configuration/CLDC-1.1 UP.Browser/ (GUI) MMP/2.0
-Samsung-SPHA680 AU-MIC-A680/2.0 MMP/2.0
-SEC-SGHD807/1.0 TSS/2.5 UP.Link/
-SGH-Z500 SHP/VPP/R5 SMB3.1 SMM-MMS/1.2.0 profile/MIDP-2.0 configuration/CLDC-1.1 UP.Link/

-Mozilla/4.0 (MobilePhone MM-7500/US/1.0) NetFront/3.1 MMP/2.0

-AUDIOVOX-PM8910KIT/T115SP0T07 UP.Browser/ (GUI) MMP/2.0

LG Electronics
-LGE-VI125V01/1.0 UP.Browser/ (GUI) MMP/2.0
-LG-CU500 Obigo/WAP2.0 Profile/MIDP-2.0 Configuration/CLDC-1.1 UP.Link/
-LG-LX350 AU-MIC-LX350/2.0 MMP/2.0 Profile/MIDP-2.0 Configuration/CLDC-1.1

Siemens BenQ
- SIE-ME45/05 UP.Browser/ (GUI)

-BlackBerry7100/4.0.2 Profile/MIDP-2.0 Configuration/CLDC-1.1

-HTC-8100/1.2 Mozilla/4.0 (compatible; MSIE 5.5; Windows CE; PPC; 240x320)

Here is a good site where you can find a more comprehensive collection of User Agents.

As you can see, its pretty simple to extract the Model Name and Manufacturer name from the User Agent, but if you are looking for more information then the UA profile is the best way to go.


  1. Some changes coming to the IE mobile browser user agent. Read more here:

  2. LG Vx8000 from Verizon (CDMA)

    User Agent: LGE-VX8000/1.0 UP.Browser/ (GUI) MMP/2.0

    The UA profile is present at