从机器人通过USB编程文件传输到电脑 [英] transfer files from android to computer via usb programmatically
问题描述
我要寻找一个解决方案,它采用Android的API,通过USB连接线从搭载Android设备传送文本文件到计算机。我发现 USB主机但我不能用这个,因为计算机不能充当设备为Android主机。
I am looking for a solution which uses Android API to transfer a text file from an Android powered device to a computer through USB cable. I have found USB host but I cannot use this because the computer can not act as a device for the Android host.
你有什么建议,我如何能做到这一点?
Do you have any suggestions how I can achieve this?
推荐答案
我已使用亚行状态窗口
来不断检查设备状态解决了这个问题,而当一个新的设备连接时,需要的文件是使用亚行拉
命令传输到电脑。
I have solved this problem by using adb status-window
to continuously check for device status, and when a new device is connected, the required files are transferred to the computer using adb pull
command.
为了实现便携式解决方案(即独立于Android平台上运行),我刚才复制的文件adb.exe和AdbWinApi.dll'到我的应用程序,并从那里使用亚洲开发银行。
In order to achieve a portable solution (i.e. to run independently of Android platform), I just copied the files 'adb.exe' and 'AdbWinApi.dll' into my application and used the adb from there.
这篇关于从机器人通过USB编程文件传输到电脑的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!