How to programmatically enable and disable USB in an Android application

in my application, I want to enable / disable the USB connection in the phone or tab (based on Android) programmatically. I searched googled but did not find any solution. If possible, give me some ideas on how to do this. some useful code for the same.

+3
source share
2 answers

This is not possible from the Android SDK.

+1
source

I know that it is already too late, but that would be useful to others. The API 12 of Android 3.1 or later introduced the UsbManager class,

Check out this link. http://developer.android.com/reference/android/hardware/usb/UsbManager.html

+5
source

All Articles