How can we detect what features are available for each device?

The active supports 64 colours whereas the 920 supports 16.

So as a developer how can I check to see which device I'm running on and more importantly the feature set of the device, i.e. can I use 64 colours or 16?

Ta.