android o usb,Android USB I/O

讨论了在Android设备上实现USB主机模式的挑战,指出默认情况下原生Android可能缺少必要的驱动。提到了需要root设备和特定硬件才能作为USB主机。还提及了一个可能的解决方案,即使用ADB端口转发和常规套接字进行应用间通信。同时,介绍了USB On-The-Go (OTG) 规范,允许设备作为USB主机。关键词包括USB主机、Android API、OTG、驱动程序和ADB通信。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试):

问题:

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.

回答3:

USB On-The-Go (USB OTG or just OTG) is a specification first used in

late 2001 that allows USB devices, such as tablets or smartphones, to

act as a host

@Wikipedia, If anybody is still looking for it

In order to manage usb traffic your device needs to become a host according to USB specification.

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值