Use the ACTION_BATTERY_CHANGED broadcast:
http://developer.android.com/reference/android/content/Intent.html#ACTION_BATTERY_CHANGED

It is a sticky broadcast, so you can use registerReceiver() to immediately
retrieve the last sent value.

On Sat, Aug 14, 2010 at 5:54 AM, Gao Jing <gaojing29.m...@gmail.com> wrote:

> I am sorry for inappropriately expression, i mean battery status, like how
> much battery left
> ?
>
> On Sat, Aug 14, 2010 at 9:38 AM, Dianne Hackborn <hack...@android.com>wrote:
>
>> Exactly what information are you looking for when you say "power status"?
>>
>> On Thu, Aug 12, 2010 at 8:34 PM, Gao Jing <gaojing29.m...@gmail.com>wrote:
>>
>>> Hi ALL
>>>
>>>     I am new to android, i want to get power status in c or c++, is there
>>> a system call in android kernel to get the power status? Like sysinfo can
>>> get memory information.
>>>
>>>    There is another question, if a java implementation  call a function
>>> in the library section of android or a system call in android kernel, how do
>>> i track down to find the exact funtion or the system call.
>>>
>>> Thanks In Advance
>>> GaoJing
>>>
>>> --
>>> unsubscribe: 
>>> android-kernel+unsubscr...@googlegroups.com<android-kernel%2bunsubscr...@googlegroups.com>
>>> website: http://groups.google.com/group/android-kernel
>>>
>>
>>
>>
>> --
>> Dianne Hackborn
>> Android framework engineer
>> hack...@android.com
>>
>> Note: please don't send private questions to me, as I don't have time to
>> provide private support, and so won't reply to such e-mails.  All such
>> questions should be posted on public forums, where I and others can see and
>> answer them.
>>
>>  --
>> unsubscribe: 
>> android-kernel+unsubscr...@googlegroups.com<android-kernel%2bunsubscr...@googlegroups.com>
>> website: http://groups.google.com/group/android-kernel
>>
>
>  --
> unsubscribe: 
> android-kernel+unsubscr...@googlegroups.com<android-kernel%2bunsubscr...@googlegroups.com>
> website: http://groups.google.com/group/android-kernel
>



-- 
Dianne Hackborn
Android framework engineer
hack...@android.com

Note: please don't send private questions to me, as I don't have time to
provide private support, and so won't reply to such e-mails.  All such
questions should be posted on public forums, where I and others can see and
answer them.

-- 
unsubscribe: android-kernel+unsubscr...@googlegroups.com
website: http://groups.google.com/group/android-kernel

Reply via email to