简体   繁体   中英

How can I get battery consumption in android?

I'm developing an app that needs the amount of battery used. I think it's impossible to do with BatteryManager or Battery Historian. Is there any method that can get battery consumption? It's better to bring battery consumption for each app, but it's okay to bring total battery consumption.

While you are running your app from android studio, you can use "profiler" tool for checking how device reacts to your app, including: RAM consumption, data and energy (battery)

Take a look: https://developer.android.com/studio/profile/energy-profiler

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM