If /sys/class/power_supply/**battery/batt_current is accessible in read.
What prevents your java app from reading this file directly? Without an
Android API?

"*If I disconnect the phone, I see the value of batt_current as '0'*"
batt_current is probably the charging current (positive integer). It
suppose the driver does not display the current drained by the system no
charger is plugged in.
Having the drained current info depends on the Power Management chipset on
your phone and its driver in the kernel.

On OMAP4 platform, TWL6030 can provide the charging current (positive) or
drained current (negative) from the battery.
The driver exposes this information in
/sys/class/power_supply/twl6030_battery/*

Emeric


On Fri, Mar 8, 2013 at 10:23 PM, <i...@attaurrehman.com> wrote:

> Hello Chaitan,
>
> I am working on the same issue. can you please tell me, were you
> successful in getting smartphone current or how much current is consumed by
> any process.
>
> Please let me know if you are successful. Your help will be really
> appreciated.
>
> Thanks
> Regards,
> Atta
>
>
> On Sunday, March 14, 2010 3:21:52 AM UTC+8, Chintan wrote:
>>
>> I am trying to collect power usage statistics for the Android G1
>> Phone. I am interested in knowing the values of Voltage and Current,
>> and then able to collect statistics as reported here
>> http://dl.google.com/io/2009/**pres/W_0300_CodingforLife-**
>> BatteryLifeThatIs.pdf<http://dl.google.com/io/2009/pres/W_0300_CodingforLife-BatteryLifeThatIs.pdf>
>>
>> I am able to get the value of Battery voltage through registering for
>> an intent receiver to receive the Broadcast for
>> ACTION_BATTERY_CHANGED. But the problem is that Android does not
>> expose the value of current through this SDK interface.
>>
>> One way I tried is via sysfs interface, where I can view the battery
>> current value from adb shell, using the following command
>>
>> $cat /sys/class/power_supply/**battery/batt_current
>> 449
>>
>> But that too works only if the phone is connected via USB interface.
>> If I disconnect the phone, I see the value of batt_current as '0'. I
>> am not sure why the value of current reported is zero. It should be
>> more than zero, right?
>>
>> Any suggestion / pointers for getting battery current value? Also
>> please correct me if I am wrong.
>>
>>  --
> --
> unsubscribe: android-kernel+unsubscr...@googlegroups.com
> website: http://groups.google.com/group/android-kernel
> ---
> You received this message because you are subscribed to the Google Groups
> "Android Linux Kernel Development" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to android-kernel+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
>

-- 
-- 
unsubscribe: android-kernel+unsubscr...@googlegroups.com
website: http://groups.google.com/group/android-kernel
--- 
You received this message because you are subscribed to the Google Groups 
"Android Linux Kernel Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to android-kernel+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to