将文件从 android 移动到 linux

Move files from android to 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。我还为 Pi 设备使用 Raspbian。

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

我建议使用以下一种方式:

1) 在 Raspberry 上设置 Web 服务器并通过 http
发送文件 2) 在 Raspberry 上设置 ftp 服务器并通过 ftp
发送文件 3) 在 Raspberry 上设置 smb 共享,在 android 上安装 smb 共享并通过 smb

发送文件