I am working on a battery monitoring app in which I have to show battery usage for all apps. After a lot of googling I found there a only way to do so is using command line
$ adb shell dumpsys batterystats --charged --checkin
The above command will provide all battery stats but I don't know how can I get this data in my code?
Please help!