Requirement : To find out which phone the user is using by parsing the user agent string from his browser.( in PHP ) eg. Nokia 1100 , Samsung D900 .
Is there a good library available with sufficient database of phone vendors and models ?
Some solutions I found, need your views on the same :
i) handsetdetection : https://www.handsetdetection.com - paid subscription
ii) WURFL - http://wurfl.sourceforge.net/
iii) Own solution - I have a small database of phone makers, and models , but will have to add tailormade checks for user agent strings in my code to match /fuzzy match against the database as user agent string format is not consistent across makers.
UPDATE:
We created a tailormade solution which was a mix of regular expressions to parise standard user agents like iOS,Android,Blackberry,and WURFL as a fallback mechanism for other phones like symbian,j2me,bada etc.
WURFL works great after adding database/cache (MySql,memcached,mongodb etc) which already exists as a setting in the core codebase.Though you have to update/sync wurfl information with newest version of WURFL handset xml database every few weeks to stay updated with specs of new released mobile phones.
First, I would say KISS (Keep It Simple, Stupid) which is a widely used expression for a reason. I would start off by double checking my business needs and see how much device information I really need and what I am going to use it for. Maybe you only need to see which rendering engine the client is using?
Second, you should consider the parsing time. If you end up using i.e. WURFL and parsing that XML on your site, you would need to parse 400 000+ lines of XML when checking for device information. Of course, you could put the XML into a local indexed database, but that would also require some maintenance scripts to synchronize the data in the updated XML with the database.
Third (but maybe it should be first?) is considering the cost/benefit of the solution. If you make money on the site, it might be smart to leave some responsibility on a partner. A hosting service like handsetdetection.com seems capable of delivering high traffic at a not-so-terrifying cost. Another benefit is that they are responsible for maintaining their own repository and could lose customers if their service isn't good enough. The OpenSource community could theoretically go on a 4 month vacation and the soulution wouldn't be maintained in that period (I really wouldn't think that should be anything to worry about ;-)
Not knowing your exact needs, I would prioritize it like this:
This looks promising and you can choose in what language you want the detection code: PHP, JS or Apache, Nginx... but as always you need to test it ;) http://detectmobilebrowsers.com
I worked on a content delivery system in the past which implemented WURFL. Seemed OK to me, never had issues!
WURFL has been mentioned here a few times already, but you should take a look at the new WURFL Cloud service - it's a hosted version of the WURFL API, maintained by the WURFL team and includes a free plan that may suit your needs.
Here's a quick PHP example of using the PHP WURFL Cloud Client:
Be sure to check out the getting started guide and the WURFL Cloud page.
This is not difficult to implement, check http://detectmobilebrowsers.mobi/#download
If you want more data, first, check if its really necessary, unless you are planning to create a mobile analytics like website, here´s why:
Mobiles can be:
Smartphones, which handle HTML5/CSS3/Javascript and sometimes even flash
Tablets, support same as above but witha a larger screen, more
interface possibilities
Medium-end phones, they have access to basic internet, some apps to connect to facebook, twitter etc, but not a fully capable browser
Low-end phones, they have a WAP browsers, very slow internet connections
So if you can segregate them in this 4 different groups, that should be enought to your application needs.
Here´s some interesting links, that will help you, to keep it simple, and do what you want to do:
Good luck!