views:

135

answers:

5

What is a good/accurate way of detecting mobile phone handsets programmatically?

A: 

Seems like you'd have to use the User Agent string. A decent list (though not necessarily up to date) can be found here.

ZombieSheep
+2  A: 

Checking value of user agent is the most common way, there are couple of open source solutions that do that for you.. try Googling for them.

Here is one example: http://detectmobilebrowser.com/

And here's also one interesting solution:
http://mobiforge.com/developing/story/lightweight-device-detection-php

Ivan
A: 

Please take a look at http://51degrees.codeplex.com/. It is an ASP.NET open source module which detects mobile devices and provides auto redirection to mobile optimized pages when request is coming from mobile device. It makes use of WURFL mobile device database. For redirection there is no need to modify existing ASP.NET web application pages.

Apart from this it also gives upto-date mobile capability information like manufacturer, model, screen height & width, image formats supported and MANY MORE...... which helps to customize pages for best mobile output.

Amit Patel
A: 

There are two header parameters you would need for handset detection.

  1. User agent - a string to identify what application or system is accessing another system.
  2. UAProf - a URL of RDF format which describes handset capabilities

Please refer to this simple example (Restlet):

http://shengchien.blogspot.com/2010/09/restful-mobile-detection.html

Sheng Chien
A: 

I can recommend WURFL for this. It's an XML file describing the capabilities of thousands of mobile devices, and combines with APIs available for .NET, Java, PHP, etc, which can recognise which device it is based on the request characteristics (primarily the user-agent header).

The web page is a bit chaotic and in sore need of an update, but the database and APIs themselves are very sound.

skaffman