[Q] Calculate energy consumption in an android activity


I'm new in developing Android applications, but for analyzing my code I need to calculate how much battery is consumed while my application is running(in mA).
I have seen some options via wake_locks or some apps, but there is 2 special requirement that makes my problem harder:
1-I need to calculate energy consumption for my activity and cannot use system overall energy consumption. for example when my application uses WiFi, I want to calculate it for scope of my activity, not system overall that could be affected by other activity.
2-I want to calculate calculate energy consumption for each device which is used in my activity rather than total energy used by activity. e.g. amount of energy that is used by WiFi in my activity, rather than overall energy that is used by my activity. even though this requirement is optional, but it helps me a lot for increasing my work precision.
3-I prefer a way that does not need rooted device.

It will not differ if I use an available app(I checked tools like Powertutor, but if more detailed will be better so I could categorized per device in activity) or I even code for it(How I can calculate energy in codes?).
I have seen some papers regarding this matter, so I think it will not be so simple.

What do you suggest for my problem?


Show Accepted Answer

Guest Quick Reply (No URL, BBcode or HTML)

Last post by ezekiel.kessler
1 hour ago
Last post by walton19
1 hour ago
Last post by glennie58
1 hour ago
Last post by ubalistreri
15 minutes ago
Last post by frances57
1 hour ago
Last post by alvera.huel
4 hours ago
Last post by richie92
1 hour ago
Last post by akoelpin
1 hour ago
Last post by reta.weimann
1 hour ago
Vivo Y21
Started by pouros.mya
Last post by kunde.alek
4 hours ago
Last post by uweber
30 minutes ago
Last post by heichmann
1 hour ago