I am writing an Android application. I would like to know how I can check if the phone is charging when my application launches?
I read this. How do I know if the phone is charging
But this register is registered only when the state of charge of the phone changes (from charging to stopping charging, or vice versa). But what if the phone is charging when my application starts, how can I cover this case?
I searched for PowerManager and USBManager in Android. No API provides what I need.
Thanks.
michael
source share