Week 17: WURFL

Introduction

Incompatibilities within mobile devices

So...

User-agent detection

The WURFL: A repository of device capabilities

How the WURFL is used from web applications

Example of using the WURFL from PHP

See here for a full example. Here is an explanation of each line of code:

More on Capabilities

The most important concept in the WURFL is the capability. A capability is a particular feature that the mobile device may or may not support, and we can query any capability. The way in which we reference a capability is:

$WURFL->getDeviceCapability(capability)
We saw an example of this above where we queried the device for its gif capability, i.e. its ability to display GIF files.

Full documentation of all capabilities is available here. There are a number of capability categories, which are described in detail on the WURFL site; they include such things as:

Most capabilities give either a true or a false value, but a few return text. For example the mobile_browser capability returns a string (i.e. text) representing the browser being used on the mobile device.

Some specific examples:

The WURFL cache

UAProf

How UAProf works

UAProf vs WURFL