简体   繁体   English

从Android到手机的USB连接

[英]USB-connection from android to phone

I'm trying to send data from android to a computer via USB, I found the USB Accessory introduction, http://developer.android.com/guide/topics/connectivity/usb/accessory.html (Basically I want to send a few bytes to a programm on the computer) So, am i right on using the accessory on android? 我正在尝试通过USB将数据从android发送到计算机,我发现了USB附件介绍, http://developer.android.com/guide/topics/connectivity/usb/accessory.html (基本上我想发送几个字节到计算机上的一个程序)那么,我是否可以在android上使用附件? What would i use for the pc programm, and can I/ Do i have to create a socket connection from my application to the programm 我将为pc程序使用什么,我/我是否必须创建从我的应用程序到程序的套接字连接

You will need access to the USB device plugged in to the PC which lets you send USB Control Request and Bulk Transfer requests. 您将需要访问插入PC的USB设备,从而可以发送USB控制请求和批量传输请求。

If you are using linux, you could try libusb - which is pretty straight forward to use. 如果您使用的是Linux,则可以尝试libusb-可以直接使用。 For windows am not sure though. 对于Windows,虽然不确定。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM