Android USB I/O

百般思念 提交于 2019-12-09 22:58:55

问题


OK, so i have seen all the stuff about how acting as a USB host is impossible on vanilla android, but is there anything in the Android API that would allow an app to override the default USB behavior in order to manually control the USB i/o responses, in order to support some other protocol? I have not seen anything that would facilitate this, but is it possible without hacking the kernel?

This seems like the sort of thing which should be relatively easy, but i haven't found anything. Forgive me if i've been googling incorrectly.


回答1:


I believe that the stock kernel does not include the correct drivers for this. You need to be able to root your device and you need one of the devices capable of acting as a USB host.

See this page, http://sven.killig.de/android/N1/2.2/usb_host/

The linked page had source for the kernel and drivers you'll need ... GOOD LUCK, you'll need it




回答2:


Last year I worked on an application that had a PC component and a smartphone component, and the two were communicating over a USB connection (using ADB port forwarding and regular sockets). So, if you want to do something like that, I'll show you how I did it, maybe it's helpful.



来源:https://stackoverflow.com/questions/3951670/android-usb-i-o

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!