通过USB从电脑传输文件,以Android设备 [英] To transfer file from pc to android device via usb

查看:1184
本文介绍了通过USB从电脑传输文件,以Android设备的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想从我的电脑的特定端口的文件编程方式传输到Android设备通过USB。哪种技术是最好的传输此模式下中:

I want to transfer a file from my pc's particular port to android device over USB programmatically. Which technique is best for this mode of transfer among the following :

  1. 插座
  2. 的HttpURLConnection。

如果有可能通过的HttpURLConnection 表示如何实现这一点?

If it is possible through HttpUrlConnection means how to implement this?

推荐答案

从PC通过USB文件传输到Android设备的 socket通信是最好的办法。

To transfer file from pc to android device via USB Socket Communication is best approach.

您需要做的端口转发一些额外的步骤在其上的Socket通信建立的。

You have to do some additional step of port forwarding on which the Socket Communication establish.

看教程<一href="https://github.com/user370305/Android-USB-Communication">https://github.com/user370305/Android-USB-Communication.

这篇关于通过USB从电脑传输文件,以Android设备的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆