views:

478

answers:

4

Is there a good way to identify a cell phone or any other mobile device (which may be subject to a limited data plan) through the user agent or similar, easily accessible methods?

A: 

You'd want to look in the User Agent for specific browsers and keywords like 'Mobile', 'Skyfire', etc. That should be a pretty reliable way. You'd want to do a Google Search for Mobile Browser UserAgents. Someone probably has made a list.

Chacha102
+2  A: 

Yes: WURFL, the Wireless Universal Resource File: "The WURFL is an XML configuration file which contains information about capabilities and features of many mobile devices."

RichieHindle
I used the information from this file to generate a series of stripos() and preg_match() calls.
Shadow
A: 

I think you cannot be certain of the exact phone used in many cases because many phones share the same user-agent string (and even use the same browser). BUt you can certainly narrow the possible candidates enough as to serve tailored content.

Check these related questions as well

Vinko Vrsalovic
Not looking to identify the phone, just whether or not it is a phone.
Shadow
I misinterpreted your "identify a cell phone" sentence then. Still you have to check for all the possible UAs, you cannot do it reliably in a single check (unless you build a monster regex)
Vinko Vrsalovic
A: 

The iPhone UA signature is:

/Apple.*Mobile.*Safari/
hobodave