battery related info android
I am just tyring to create an activity which shows the battery level in the picture format automatically when ever there is a change in the battery status so any one can suggest me the proced开发者_Go百科ure to create that type of app
Information related to the battery manager can be found here:
http://developer.android.com/reference/android/os/BatteryManager.html
It's used in conjuntion with the ACTION_BATTERY_CHANGED Intent, which fires every time there is a change in the battery state (charge level, connected, fully charged, etc).
You can get some inspiration from the Android Settings's source code(mainly in the package: com.android.settings.fuelgauge).
http://grepcode.com/search?query=PowerUsageSummary&n=
http://grepcode.com/file/repository.grepcode.com/java/ext/com.google.android/android-apps/4.3_r2.1/com/android/settings/fuelgauge/PowerUsageSummary.java#PowerUsageSummary
精彩评论