How can I check the status bar colour in Android?
Why do I need to check this? I have created my status bar icons as per the design guidelines however on some devices (Samsung Galaxy S) the status bar is black and it is running Android 2.1.
The recommendations for the status bar icons look great on Android 2.3 (Nexus S) and within the emulator (earlier Android 2.1) with the default light grey status bar. However the black icons that are recommended for pre-2.3 don't look clear on the Samsung Galaxy S.
I would like to provide a white icon if the Android is running 2.1 or 2.2 with a black status bar.
Basically the problem is that the Android design guidelines don't really cover the phones that changed the UI like the Samsung Galaxy S. For example the Samsung Galaxy S running Android 2.1 should have a light grey status bar but it has a black one. This doesn't fit in well with Google's provided design guidelines.
Usually you are suppose to bind this via the manifest file but there is a way to get the value: Use the Build.VERSION.SDK_INT and check it against the Build.VERSION_CODES, http://developer.android.com/reference/android/os/Build.VERSION.html
you can get the more interesting read from an android dev blog post here
--edit--
You will have to figure out what device you are on from BUILD but don't forget people have themes as well...
Short of ripping up the framework and the status bar app, that is going to be the best... here is a link if you want to try digging into the StatusBar and getting it from the raw Framework.jar...
Here is a link to a guy who mentions how he handled playing with the status bar.