FORUMS

[Q] How to get charge current value from Nexus 5?

217 posts
Thanks Meter: 38
 
By 11alex11, Senior Member on 30th May 2014, 06:33 AM
Post Reply Subscribe to Thread Email Thread
I found that the charge current of almost all the devices being written to a file system location.

I found that file in Nexus 5 but the problem that the value is changing and not permanent. This is the path of the file: /sys/class/power_supply/battery/current_now

Anyone knows how to get permanent charge current value?
 
 
1st June 2014, 08:48 PM |#2  
MasterAwesome's Avatar
Recognized Developer
Thanks Meter: 1,292
 
More
Quote:
Originally Posted by 11alex11

I found that the charge current of almost all the devices being written to a file system location.

I found that file in Nexus 5 but the problem that the value is changing and not permanent. This is the path of the file: /sys/class/power_supply/battery/current_now

Anyone knows how to get permanent charge current value?

File file= new file(pathtodir/hello.txt) ;
Process process = Runtime.getRuntime().exec(new String[] { "su", "-c", "cat /sys/class/power_supply/battery/capacity > hello.txt"});
BufferedReader br = new BufferedReader(new FileReader(file)); String line; while ((line = br.readLine()) != null) { //toast your battery here } br.close();


Regards
MasterAwesome
Post Reply Subscribe to Thread
Previous Thread Next Thread
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes