1

Well i have read a lot of answers of similar questions (even if they are old from like 2013-2014) and i understood that it is not possible to know it exactly since android doesnt count the hardware usage as usage of the app, and some other possible problems like services etc.

At the moment I'm trying to test the perfomance of an App using a protocol to reach a goal and the perfomance of the same App using another protocol (not well known by everyone) to reach the same goal, the default android battery analyzer is good for me since both cases are like 90% the same and i know how the protocols work

Percentage of battery used by my App Android Client

Level Battery consumed in mAph

Level Battery consumed in mAph

My problem is that i'm not sure which one is the best to measure the mAph consumed by my App, i know that there are some external apps that shows it but i would prefer using the one of default, I believe this is something important not only for me but for other people who might have to compare different protocols. I know that i can measure it programmatically and I've done it too, i save the percentage when the app is opened and how much has been consumed until it gets closed, but it isnt an exact measure since while the app is opened some other apps can do heavy work and add some kind of noise of what i'm measuring so i would prefer to use the android's battery analyzer.

HarshitMadhav
  • 4,769
  • 6
  • 36
  • 45
Steven_95
  • 75
  • 8

1 Answers1

2

Get a spare device. Load it completely, then run the protocol until shutdown without other interaction (no youtube or anything), note the time it lasted. Repeat with the other protocol. Imho that is a fair way to compare. Note that every device behaves differently and it may or may not be possible to transfer this result to other devices e.g. with different network chips, processors or even firmware versions.

For a more fair comparison I think you should compare how the protocols work. I.e. number of interactions, payload size etc. because the power consumption can only ever be an estimate.

leonardkraemer
  • 6,573
  • 1
  • 31
  • 54
  • mmm do you have any suggestion on how to have a device with only my app? i mean without youtube or the apps that cant be uninstalled (I'm using google maps api so i believe that i need at least play services updated) and yeah part of my report is also a comparison on how they work in terms of payload size, how they solve some problems etc. – Steven_95 Sep 09 '18 at 17:13
  • I didnt mean no other app, although that would be desirable. Just dont actively use anything else. In the end this kind of test is only accurate if you app uses way more energy than anything else. Nevertheless you can disable most apps. – leonardkraemer Sep 09 '18 at 22:32
  • well yeah i've done the reboot and waited for some minutes before starting test for 6 hours and almost all the usage of my phone was because of my app, thank you for answering, do you have any idea of which screenshot gives the mesaure (aprox) of mAph consumed while the app was opened? when i go to app details it says 'level of battery consume: 231,9 mAph' and when i go to battery usage details it says '<1mAph' – Steven_95 Sep 11 '18 at 08:05
  • as far as i understood everything should have been reseted after the complete charge, so i wonder how those two values can be so different – Steven_95 Sep 11 '18 at 08:06