Device Detection and Capabilities

We looked at what WALL can do and how easy it is to implement it. But how does it do that? WALL, and many other open-source (and commercial) tools use WURFL—Wireless Universal Resource File. The mDevInf tool that we saw earlier in this chapter is entirely based on WURFL. WURFL is a massive XML file, listing capabilities of all known mobile devices (almost!). It is actively maintained and also derives information from UAProf—another standard for managing device capabilities.

At the heart of any device detection is the User Agent header sent by the browser. All device detection techniques check the User Agent ($_SERVER['HTTP_USER_AGENT'] variable for PHP) and look up their database to find the characteristics of that device.

Here are some of the things WURFL can tell you about a device:

The list goes on. But you can make some intelligent decisions in your application based on the device now. You can even conditionally print <wall> tags. E.g. show a download link only if the device has download support.

WURFL API is available in many programming languages, including Java, PHP, .Net, Ruby, and Python. You can download it from: http://wurfl.sourceforge.net/.


XML Processing can Bog Down My Server, is There Something Easier?

Yes! The WURFL XML file is above 4MB, and despite many structural optimizations, processing it on every request will certainly slow down your server. Many APIs provide caching to speed things up. But having this available in a database will be best. Tera-WURFL is a PHP package that uses MySQL to store WURFL data. It bundles WALL and an admin panel—making it the top choice for mobile web adaptation.

Setting up Tera WURFL involves downloading the latest package from http://www.tera-wurfl.com/, extracting the files and entering the database connection information in the configuration file. It will load up the device data to the database and can start serving WALL pages.


What About W3C's DIAL?

W3C's DIAL (Device Independent Authoring Language) is a combination of XHTML 2, XForms, and DISelect. DIAL (http://www.w3.org/TR/dial/) was created to develop a language that will allow consistent delivery across devices and contexts. Though the language is new, it's getting a good response and is something to keep track of!


Previous Page Page 3 of 4 Next Page


Feedback Form (ExpandCollapse)

What do you think about this web page?






(Optional) Please provide us more details. For example, suppose you select option 2 above, can you tell us specifically what information is missing? You can also suggest anything that can help us improve this web page.

(Optional) Your name:

(Optional) Your email address:

Please enter again to confirm:

Due to the amount of messages we received, we may not be able to reply to all messages.

A button for going back to the top of this page