For a test we are conducting we need to measure the power consumption, which our background android service uses.
Is it possible to get the power usage in mAH, which our app has been using from the moment we disconnect the power supply, in code (Java or Xamarin C#)? If yes, how.
This similar as in (android 6.0) Settings->Apps->MyApp->Battery, section Computed power use.
Thanks in advance!
Edit
We have looked into the Battery Historian but we are deploying this test app on a few devices, which we cannot dumpsys each day to pull statistics from. Thats why we are making a API backend and a small app to measure our usage.