Mobile Web platforms are designed to address the key challenge of the Mobile Web ie. what markup to serve for a given device. Most have the following key components:
- A device database
- A module that maps the request’s UA header and either redirects to the appropriate site or serve out the appropriate markup
The first stores all the information needed by the platform to make decisions on the markup to serve (and usually extra information for future extensions eg. video capability etc).
The second (a more complex piece) has to decide, with just the UA, how to proceed. This is usually done in one of 2 ways: (a) complete UA match (b) UA pattern match. The former is pretty straightforward but as has been described in the previous posts – a single handset model may have a hundred User Agents strings. As for using regex patterns, sometimes the UAs handset makers use cause issues eg. the “classic” versions of several Nokia models (eg. Nokia 3120 classic) – the originals were WAP 1 but the classic versions are WAP 2 /xHTML capable. The problem occurs because their UAs are so similar and requires some careful regex construction.