Is there a way to get battery information from the Android SDK? Such as battery life remaining and so on? I cannot find it through the docs.
+3
A:
You can register an Intent receiver to receive the broadcast for ACTION_BATTERY_CHANGED: http://developer.android.com/reference/android/content/Intent.html#ACTION_BATTERY_CHANGED. The docs say that the broadcast is sticky, so you'll be able to grab it even after the moment the battery state change occurs.
Jarett
2009-11-26 22:22:35
This is exactly what I was looking for. Thanks a lot.
Jeremy Edwards
2009-12-02 02:15:01
No problem. I know how hard the Android SDK docs can be to navigate sometimes.
Jarett
2009-12-02 14:30:44
Can you post some sample code for this. I'm not sure how to receive a broadcast intent.
Jeremy Edwards
2009-12-21 05:59:52