Check Usb Connection Status On Android
I was wondering if would be possible to perform an action for each time the USB status of the device changes. For example if the user plugs in the cable and it is in sync/charge m
Solution 1:
Is this actually possible.
Sure.
Android broadcasts various Intents
that you can listen to with a BroadcastReceiver
. Among these are:
ACTION_BATTERY_CHANGED
(tells you if device is plugged into USB or AC)ACTION_UMS_CONNECTED
andACTION_UMS_DISCONNECTED
(tells you if device enters or leaves USB Mass Storage mode)
Post a Comment for "Check Usb Connection Status On Android"