Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/android/181.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
将文件从android移动到linux_Android_Linux_Raspbian - Fatal编程技术网

将文件从android移动到linux

将文件从android移动到linux,android,linux,raspbian,Android,Linux,Raspbian,我正在为android编写一个应用程序,在这个应用程序中,我想向Raspberry Pi设备发送一个文件。我做了一些研究,我意识到我需要使用scp命令来完成这项工作 scp path/to/file user@ip.of.linux:/path/to/destination //I dont know where to put this code 现在我想知道如何在我的Android应用程序中运行这个linux命令?这里有图书馆吗?如何运行scp并将文件从android移动到linux 我正

我正在为android编写一个应用程序,在这个应用程序中,我想向Raspberry Pi设备发送一个文件。我做了一些研究,我意识到我需要使用
scp
命令来完成这项工作

scp path/to/file user@ip.of.linux:/path/to/destination
//I dont know where to put this code 
现在我想知道如何在我的Android应用程序中运行这个linux命令?这里有图书馆吗?如何运行
scp
并将文件从android移动到linux


我正在使用unity进行android开发。我的android和linux设备(Raspberry Pi)连接到同一个wi-fi。我还使用Raspbian作为Pi设备

scp
是一个linux程序,您的android设备上可能没有它(通常android设备没有安装
scp

我建议使用以下几种方法:

1) 在Raspberry上安装web服务器并通过http发送文件
2) 在Raspberry上设置ftp服务器并通过ftp发送文件

3) 在Raspberry上设置smb共享,在android上安装smb共享,并通过smb发送文件

也可以通过
ssh
发送文件吗?
scp
是一种
cp
over
ssh
),android设备上通常没有现成的ssh客户端或服务器。当然,您可以在设备上安装ssh和scp,但它可能需要根用户或重新构建的ssh/scp UTIL。你确定要这么做吗?无论如何,您可以从应用程序中以
processprocess=Runtime.getRuntime().exec({command})的形式运行终端命令
并获取进程的输入/输出流,以读取命令输出/写入命令。