开发者

How long android battery is in discharging mode

I need to know how long my android phone is in discharging mode.For this what i am doing now is- using broadcast receiver to listen when phone is unplugged from charging.Then saving this time in memory.Whenever i need to know the discharging mode period i a开发者_JAVA技巧m finding the difference between current time and the time i have stored previously.

I want to know is there any other way to find this.

Thanks in advance


Recieve the ACTION_POWER_DISCONNECTED and ACTION_POWER_CONNECTED intent:

http://developer.android.com/reference/android/content/Intent.html#ACTION_POWER_DISCONNECTED

And just store the time of the disconnected event.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜