How to disable/enable USB on Android

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

How to disable/enable USB on Android

4,366 次查看
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.

标签 (2)
0 项奖励
回复
2 回复数

1,893 次查看
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 项奖励
回复

1,893 次查看
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 项奖励
回复