如何将开发主机的 USB com 端口设置为 Android 虚拟设备的 USB 端口?
我是 Android 开发领域的新手,但在嵌入式系统方面有一些经验。
我想使用 Android 手机(4.x 或更高版本)通过其 USB 端口控制其他设备。我们希望将 Android 设备设置为 USB 主机,因此解决方案其他设备扮演主机角色(例如 Android Open Accessory Development Kit 的Arduino)将无法实现我们的目标。
我们目前正在使用 Eclipse-SDK 进行 Android 开发,并成功编译/运行/调试了多个应用程序。然而,我有一个非常幼稚的问题。我想知道是否有一种方法可以使用开发主机 PC 的 USB 端口作为 Android 虚拟设备模拟器的输入。
我意识到调试我们正在编写的 USB 主机应用程序的一种更简单的方法是拥有一个真实的设备。然而,新的 Ice Cream Sandwich 设备的价格在某种程度上远远超出了我们的承受能力,并且不是在早期阶段调试应用程序的理想方式。
我感谢您为我提供的任何帮助。
I'm a newbie to the Android development world but have some experience with embedded systems.
I'd like to use an Android phone (4.x or higher) to control other devices via its USB port. We want to set the Android device as a USB host, so solutions where other devices play the host role (e.g. Android Open Accessory Development Kit's Arduino) will not meet our goal.
We are currently using Eclipse-SDK for Android development and successfully have compiled/run/debug several apps. However, I have a very naive question. I was wondering if there is a way one could use the USB port of the development host PC as an input to the Android Virtual Device emulator.
I realize that an easier way to debug the USB-host apps we are writing would be by having a real device. However, the price of the new Ice Cream Sandwich devices is somehow far away from our reach and not the ideal way for debugging an application at its early stages.
I appreciate any help you can provide me with.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
Android 开放配件开发套件已向后移植到 2.3.4,请参阅此处 http:// /developer.android.com/guide/topics/usb/adk.html
因此安装 CM7 或更早版本 (http://www.cyanogenmod.com/) 满足您的 HTC 愿望,您应该可以开始了!
查看 2.3 SDK 的示例项目应该可以帮助您朝着正确的方向前进。
对我来说,SDK 示例的路径是 C:\Program Files\Android\android-sdk\samples
如果您正在寻找 USB 主机支持,基本上控制并与另一个 USB 设备(如鼠标、键盘、USB 拇指驱动器等)通信,以下内容应该有所帮助。
Nexus One 作为 USB 主机:http://sven.killig.de/android/N1 /2.2/usb_host/
USB 主机:Android 手机的外部 USB 设备?
官方 Android SKD UsbDevice 类:http://developer.android.com/reference/android/hardware/usb/UsbDevice.html
The Android Open Accessory Dev kit has been backported to 2.3.4 see here http://developer.android.com/guide/topics/usb/adk.html
So install CM7 or earlier (http://www.cyanogenmod.com/) on your HTC desire and you should be good to go!
Look at the example projects for the 2.3 SDK should help get you going in the right direction.
Path to SDK Samples for me was C:\Program Files\Android\android-sdk\samples
If your looking for USB Host Support basically control and talk to another usb device such as mouse, keyboard, usb thumb drive etc the following should help.
Nexus One as USB Host: http://sven.killig.de/android/N1/2.2/usb_host/
USB Host: External USB devices to Android phones?
Official Android SKD UsbDevice Class: http://developer.android.com/reference/android/hardware/usb/UsbDevice.html
您应该看看这个项目,它是一个很好的参考
https://code.google.com /p/mover-bot/
You should take a look at this project, its a great reference
https://code.google.com/p/mover-bot/