It seems like facebook has this mastered, I've checked a bit into WURFL but this seems like an extremely expensive process. I've also checked out: url link. While it has a good list of user agents, I'm trying to identify which are smart phones and which are not.
facebook pushes the non-smart phones to a different site than their smart phones. Trying to see if there was an easy way to do this.
You should look into Tera-WURFL which is basically WURFL serialized data in a MySQL database. Much better performance than XML WURFL.
There is also another mobile device db out there: Device Atlas.
What you could do is find the lowest common denominator for smartphones, then create your own stripped down version of WURFL / Device Atlas which would be far less resource intensive and faster to check, and go from there.