04-16-2009 11:35 PM
I'd like my application to know when the user starts charging their device (ex. in the charging pod).
One possible approach is to run a thread that, once each second, checks the value of the getBatteryStatus().
Is there a cleaner way to do such a thing, whereby an event in my application would be fired when this value changes?
04-17-2009 12:52 AM
You can use SystemListener for this purpose... Have a look at this thread just for reference
Use the following method from system listener..
public void batteryStatusChange(int status)
If(status == DeviceInfo.BSTAT_CHARGING)
This is the cleaner way of achieving this..
04-17-2009 03:07 AM
This KB article will give you a good learning about SystemListener