[Q] Low Power Battery State Sensing - Other Operating Systems and Languages

Hi, I'm looking for a very low resource way of measuring power draw over a time interval. I'm looking to measure the power draw as various pictures and videos are displayed on the screen to get an idea of how much power the various components of the phone draw. I've done some looking and I've found this: http://developer.android.com/reference/android/os/BatteryManager.html. Particularly, I noticed Charge_Counter, Current_Average, and Energy_Counter. My issue is that while I have a bit of a programming background (more like a hobby), I have no idea where to start with this. I have some background in Python, Labview, linux scripting, and very little C and .NET, so I understand some of the basic concepts of programming, but anything beyond that is something I would have to pick up. I have virtually no experience in Android programming (other than a few Cyanogenmod compiles from source - as anyone who has been around long enough has ).
I wouldn't need a gui for this, so something like a script would work great. It can (maybe should) be able to be executed via ADB, and needs to be universal - working across modern devices. The app/script I'm envisioning would perhaps poll the battery for a power level, wait a specified time - 2 min, 5 min, 10 min, 1 hour, something like that - then poll it a second time, get the delta, and divide by time to get an average power. Other than those two polls, I would want the app/script to have no interactions with the processor. The greater the accuracy, the better, and if no root is possible, that would be my choice. I would prefer to keep the phones as stock as possible.
My questions are:
- Is something absolutely universal (or mostly universal among newer devices - say 1 yr old or less) possible (no root)?
- Since it needs to be universal, would Java be a good choice of programming language? Or perhaps this can be accessed via the command line (script)?
- How accurate would a method like this be? How do the phones know the instantaneous current, power level, etc? Is it basically a shunt resistor, measuring the V across?
- How much time would it take (generally) for a noob with no Android experience to get a working demo? Days, weeks, months?
Thank you for your time.

I would also mention, this doesn't have to be "polished" for an audience...just simply looking for a down and dirty method that works - mostly for myself.

Related

[Q] Galaxy Note Overclocking

I'm curious about the state of fine tuned overclocking on the note.
Of course, we have Da G's OC Kernel, and a couple roms.
But i've never been so unlucky when it comes to receiving some free performance via overclocking.
I've been blessed with a solid piece of silicon on my transformer and my desktop setups.
I find that even at 1.72ghz, i FC every 20-25 minutes or so. Just enough to make me want to avoid OCing it.
At 1.78 it's worse, and although i've heard that the majority of users have no issues at 1.83 ghz, i crash hard at that settings--within a quarter-minute of applying it.
I've tried different governors, and had more luck with smartassv2. I have a feeling that i just received a mediocre piece of silicon.
I only have a couple options-- i've had other issues with my note--namely the buttons; soft keys, as well as hard, and display brightness--unfortunately im just past my 30 days to return the note, so i'd have to replace it through Black-Tie Protection....i have no idea how this even works.
The other option is to bump up the voltages, but in SetCPU, there are no options, and CPU Master is the same. The only app I've found that even lists voltage options is System Tuner Pro, and while i'm not fond of the UI, i could deal with it.
Edit:
It turns out, bumping up the voltages @ 1.83ghz to 1375mV seems like it buys me a few seconds more before i crash and burn, but this could be a placebo affect.
So, the pupose of this thread is two-fold:
A: Find out if voltage adjustment is a function of the app, and a logic board component.
B: Find out if voltage adjustment must be supported at the kenel and/or ROM level in order to function, and the settings i'm changing are just dummy settings without said support.
2.
A: Find out how much variation on overclocking yield is standard.
B: Poll and share the results.
it is non sense having a poll for that because although we have the same device, still they are not the same if u know what i mean. stop overclocking if it crashes unless you want your phone to die, or just get it replaced with another one and see if it works fine. 1 question, why you need to oc?
This thread is for discussing overclocking methods, settings, support, and to answer my questions about the above listed specificity.
The poll is meant to survey our (us @ the LTE Galaxy Note forums on XDA) sample (albeit, a small one) to find out where our numbers fall. Unless we have a volunteer to read the thread every day, and report back on how many users are stable @ the clock speeds listed above, a poll is the most efficient, concise, objective, and standardized method to gather such information via forum.
Us non-cyborgs (organic humans) just don't do well when it comes to looking at a ton of numbers and extrapolating 411 from 'em over, and over, and over again.

[Q] Energy consumption details per application in android

Hi all
I'm working on an academic project and I need to measure how much energy is consumed by my application.
But my requirements are annoying and I have not found anything that cover all my requirements.
I like to know if you know anything that can help me.
My requirements:
1-I need to calculate energy consumption per sensor/device for my application. For example I need to see how much energy is used by GPS or Wifi in my app.
2-I need to results in mAh. Percent results are somehow ambiguous for my tests(they may be good in normal usage to see what has spent most of your energy,but not in my case).
3-I want to get these work on Galaxy S5. Then Android 4.4.2 and its limitations.
4-I don't want to use rooted device.
I have tried powertutor(even though I'm not sure if it works correctly in android 4.4.2). Rather than this tool do you know anything else?
I thought if there is any app that can run another app in an isolated environment to calculate its energy consumption.
Because I'm writing my target app, even I can add additional codes in it for calculating energy costs.
I have seen several papers for calculating energy cost in various journals, but I prefer a simpler approach.
Any idea if it is possible to do so at all?
Regards

Linux Load Avg Meaningful on Android?

Hi,
I have experience with Linux servers but not so much with Android.
I bought a Samsung Galaxy tab E a couple months ago. It has started lagging plus occasionally the screen flashes blue.
The first idea I had was cpu temp or overload. Being Linux oriented, I opened a console and typed "top". The load average varies between 7 and 9. Which if it were a server I'd start hunting for problems.
Should I care what the Linux Load average is on android? If yes, how high should an android device's load Avg be if the device has not been used? Iow, say I close it for 15 minutes, open and check load Avg.... Should it be 5,6,7?
I realize every situation is different. I'm only asking for a ballpark idea.
My thinking is if the Linux load average is this high it could be causing the lag. I can't root this device until I can be sure the problems are not hardware related since I still have a valid warranty.
Any and all input is appreciated and thanks
Htop on android
Hi, the load avg on android are always high, higher than they should be anyways if you are talking server or x86 system.
Ignore them, your phone is running fine.
I personally think the difference is in the ARM architecture(anybody with a pi could find out) or the operating system itself.
When running nothing and cpu % under 15 I get load avg above 5. Nonsense, ignore it, at least that is my advice. I would love to know the technical reasons why this happens.
an old discussion on topic is here:
https://www.google.com/url?q=https:...ds-cse&usg=AFQjCNEPbDM4ZMV_JK-iwXvbFr1YJfsxKA

solid, consistent benchmarking

Hey guys
I'm recompiling a kernel for my Galaxy S5. I'm disabling some parts of kernel code, trying different toolchains and compile options
But, how do I know if any of if is being effective in getting more performance out from my phone?
I know there are many benchmark apps out there, but I've tested ~10 and they all give inconsistent results. I mean, they all look pretty and stylish, but who can trust in a 1-minute test, with varying results even when not changing anything on the phone?
Don't tell me benchmarks are BS, because you have decent benchmarks for Databases (I work with some of them), Desktop PCs (even Windows had a built-in one), memory, disks, TVs, etc... I'm used to test and compare "things" forever, but I'm used to solid and consistent results. Sadly in Android world people give too much attention to pretty graphics or hearty words like "Your phone is fantastic" (this is the type of "conclusion" some benchmarks apps out there gives... LOL)
So, how to test a Kernel's performance in Android? Do I have to learn Java and create my own...? I hate Java!

New to anything like this. May I ask a few questions?

I barely understand what this means, however I have discovered that by going through tutorials, that one could do things like improve sd card performance, improve battery life, and many other things. Of course this interests me, but as I said I am new to android and I barely understand what this really means. I have hacked a lot of gaming consoles in the past and jailbroken many iphones, but that is about it. Definitely very new to all of this.
My device is the UMIDIGI A3X. Would it be possible to flash stock Android 10 onto this device (once I learn how to do this safely, still have to learn this) and then simply follow tutorials on kernel tweaks for the desired changes I want, without really truly understanding this kind of programming on a real level? In another words just going through the steps for the desired performance changes I seek.
Or am I way out of my depth here?
IMO SD-card performance basically has nothing to do with Android OS itself - but of course you can change relevant Android's cache size setting what probably doesn't result in any measureable results. Also you've to distinguish SD-card's IO read / write speed what depends on both the type of data bus the Android device supports and the SD-card's speed-class ( 2 - 10 ).
And battery life doesn't depend on Android OS: it solely depends on how the device - read: its CPU/GPU - is used/stressed and - most important - whether battery is always correctly charged ( never less than 30%, never more than 80% ).

Categories

Resources