Detect and Direct Mobile Devices
Before delving into the details of the most complex ways of managing device detection, this section begins with an overview. If you want to deliver different versions of a website to the thousands of different devices now in use on the web, follow these general steps:
Develop device groups based on device capabilities.
Determine which devices you want the design to look good on. Thousands of mobile phones and other devices are used by visitors. Categorizing devices into manageable groups based on factors such as screen size and the level of multimedia support enable you to focus on one group at a time.
For example, you may want to send the same image to an iPhone and iPod touch because their screen sizes are similar, while sending a larger image to the iPad to take advantage of its larger screen.
Develop (or acquire) a device database or a configuration file.
To deliver the right version of your site to the right device, you need a configuration file or database that contains detailed information about every device. Many private companies create their own device databases, but you can also use the open source Wireless Universal Resource FiLe (WURFL).
Write (or acquire) a program that can deliver the right version of your site to the right device.
The challenge in this step is to develop an application that can match the contents of the device database with the different design options (device profiles, special URLs, or other parameters) you’ve created for your site. Though top mobile design firms create their own solutions, a great place to get a head start is Andy Moore’s device detection script.
Develop a design that you can adapt to the needs of different devices on the fly, or create multiple designs, each optimized for a different device or device profile.
When you use either approach, expect to spend a significant amount of time creating designs that display well within the constraints of each device.
Test, test, and test again, making adjustments as needed.
The many variations among devices and the sheer number of devices in use on the mobile web make it almost impossible to deliver a perfectly optimized page to every device every time. Even if you get your mobile design strategy right, the mobile web is a moving target. Develop a strategy that best meets the needs of your site users now (and works within the limitations of your time and budget), and make refinements to keep your strategy up-to-date later.