How to disable/enable USB on Android

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

How to disable/enable USB on Android

3,444 Views
kyke
Contributor I

Hi,

I had build an android application which uses the accessory manager to connect to an external PIC. This connection uses the USB OTG from the imx6 board to connect to the PIC.

The problem is that if the cable is connected before Android boots it doesn't recognize the device, so I can't connect with it, and the application becomes useless.There is someway to simulate a new connection without remove and connect the cable manually? I had though use some linux command line or script which enable/disable the OTG USB. I know how to execute commands from Android, but my knowledge about Linux is a very rusty.

kind regards,

and thanks for your time.

Labels (2)
0 Kudos
2 Replies

971 Views
SergioSolis
NXP Employee
NXP Employee

Hmmm, I'm not completely sure about how to do this, but looking into this URL:

USB Host | Android Developers

Look for this section: Using an intent filter

Please take a look at it, it may help you.


Best regards,
Sergio

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 Kudos

971 Views
kyke
Contributor I

Thanks for your time Sergio, but I had take lot of time reviewing this and there is no option for do it from Android side, that's why I need modify the linux kernel to introduce this option.

Anyway thanks for your time and help.

Best Regards.

0 Kudos