Is there any way to profile the battery usage by the application in development environment or real time? BatteryManager seems not providing any per application API
I don't think that is possible at the moment.
There is a private API, PowerProfile, for retrieving battery consumption on a subsystem level (see http://grepcode.com/file/repository.grepcode.com/java/ext/com.google.android/android/2.2_r1.1/com/android/internal/os/PowerProfile.java). Also take a look at the code for the fuel gauge you find in Android's settings on how they calculate power consumption: http://google.com/codesearch/p?hl=en#ohAXAHj6Njg/src/com/android/settings/fuelgauge/PowerUsageSummary.java
1.4m articles
1.4m replys
5 comments
57.0k users