Android Battery usage profiling

前端 未结 4 571
萌比男神i
萌比男神i 2020-12-12 22:54

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

相关标签:
4条回答
  • 2020-12-12 23:20

    You may want to take a look at Trepn Profiler by Qualcomm. Its features are:

    • Profile device, or a single app
    • Display battery power
    • View CPU and GPU frequency and utilization
    • Display network usage (cellular and Wi-Fi)
    0 讨论(0)
  • 2020-12-12 23:21

    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

    0 讨论(0)
  • 2020-12-12 23:27

    There's a new tool called "little eye" that does this.

    It can profile Battery, CPU, Wifi and Data usage for an App in a development environment. Its a commercial product, but in beta right now, so free to download (for the moment). (disclaimer: I work at little eye)

    http://www.littleeye.co

    0 讨论(0)
  • 2020-12-12 23:35

    you can use the two classes: IBatteryStats and BatteryStatsImplernal in package com.android.internal, they provide methods to get the statistics of battery usage.

    0 讨论(0)
提交回复
热议问题