Creating a mobile phone application (or mobile friendly website) can be an absolute pain in the ass. Each phone has a slight variation in what it does and does not support.
There is a handy database for mobile phone (or as the yankees call them, "cell phone") specifications called WURFL.
The configuration file they provide lets you know capabilities of a phone such as what HTML support, CSS, Ajax, display size and color depth, image/audio/video formats supported, storage method, streaming support, MMS, J2ME and Flash/PDF support.
Not to mention the basics such as manufacturer name, model, keyboard type, operating system and wireless capabilities.
The documentation page is a bit difficult to find, but linked here (mainly for my own reference).
Be warned, it is a comprehensive list so it takes quite some time to process it. You should not be accessing it on a per view basis.
[ WURFL site ]