I can recommend WURFL for this. This is an XML file describing the capabilities of thousands of mobile devices and combined with APIs available for .NET, Java, PHP, etc., which can recognize which device it is based on the characteristics of the request (primarily the user agent header).
The web page is a bit chaotic and needs to be updated, but the database itself and the API are very simple.
source share