How to get percentage of battery usage by each app in android programatically

让人想犯罪 __ 提交于 2019-12-05 02:38:41

问题


I am making a demo for battery usage percentage by all apps.I am able to get the total available battery percentage but want to get battery usage by percentage by each app separate.So Is there any way to do so as lot many apps are available in market.Please help or suggest to save newbie.


回答1:


Only battery usage screen in Settings, where you can see battery usage of each application. There is no API or command-line way to get this information. See similar question discussion in stackoverflow :Android: Battery usage of each application



来源:https://stackoverflow.com/questions/35867241/how-to-get-percentage-of-battery-usage-by-each-app-in-android-programatically

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!