Tutorial about Detecting User Agent Types and Client Device Capabilities

Preferences - Do not show ads

A major problem faced by mobile application developers is that wireless devices such as cell phones have very different capabilities. One feature that is supported on one cell phone model may not be available on another model.

There are a number of methods for detecting the features and capabilities of a user agent or wireless device. In this tutorial, we focus on two of them. The first method is to make use of HTTP headers such as Accept, User-Agent, Accept-Charset and Accept-Language. The other method is to retrieve information from a UAProf (User Agent Profile) document. UAProf was defined by the Open Mobile Alliance for user agent detection and client device capabilities detection.

Table of Contents

User Agent Detection and Client Device Capabilities Detection


Headers in HTTP Requests

The Accept Header -- Find the MIME Media Types that will be Accepted by a User Agent

Common MIME Types List

The User-Agent Header -- Identify a User Agent and Client Device

To Identify a Specific Mobile Device Model with the User-Agent Header

To Differentiate Mobile Devices or User Agents Made by Different Companies with the User-Agent Header

To Determine Whether a User Agent is a Web Browser on a Personal Computer or a Microbrowser on a Mobile Device with the User-Agent Header

The Accept-Charset Header -- Find Character Sets that are Supported by a User Agent

The Accept-Language Header -- Find the Language Preference

The x-wap-profile Header and the Profile Header -- Find the UAProf Document of a Mobile Device

How to Read the Value of an HTTP Header

Retrieving HTTP Headers with ASP

Retrieving HTTP Headers with Java Servlet / JSP

Retrieving HTTP Headers with Perl

Retrieving HTTP Headers with PHP

Using UAProf (User Agent Profile) to Detect User Agent Types and Device Capabilities


Where to Find the URL of the UAProf Document of a Mobile Device

UAProf Profile Resolution

Free Library / Tool for Retrieving UAProf Attribute Values

A Simple Way for Retrieving UAProf Attribute Values

UAProf Components and Attributes

Collection Types and Attribute Types in UAProf