Android 手机和 PC 之间的文件共享
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/2084700/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
File sharing between Android phone and a PC
提问by M-V
I am new to the Android SDK. Is there a way to share files from my Android app, so that it can be accessed by another computer using WiFi? Is there support for something like SMB? (Android version on phone is 1.6) Thanks.
我是 Android SDK 的新手。有没有办法从我的 Android 应用程序共享文件,以便另一台计算机使用 WiFi 访问它?是否支持 SMB 之类的东西?(手机上的Android版本是1.6)谢谢。
采纳答案by ERR0
There is an android SMB library available here: http://code.google.com/p/sambaexplorer/
这里有一个 android SMB 库:http: //code.google.com/p/sambaexplorer/
There are also some existing android SMB products out there like Pander-sync: http://www.pader-sync.com/mobile-smb-client.html
还有一些现有的 android SMB 产品,如 Pander-sync:http: //www.pader-sync.com/mobile-smb-client.html
回答by BK.
Another option is to look into the JCIFSlibrary. SMB (or CIFS) could be made possible this way. Although, I would suggest you look into some other mechanism for talking between your Android device and another computer. Simple file browsing is one thing, but actual communication back and forth is a little more complicated. You might want a daemon or systray app on the computer side.
另一种选择是查看JCIFS库。可以通过这种方式使 SMB(或 CIFS)成为可能。虽然,我建议您研究一些其他机制,以便在您的 Android 设备和另一台计算机之间进行对话。简单的文件浏览是一回事,但实际的来回通信要复杂一些。您可能需要计算机端的守护程序或系统托盘应用程序。
Additionally, there could be some concerns related to security with SMB/CIFS. You might have issues with the permissions on the computer, complexity of the configuration for the end-user on the Android side, or both. Just a thought!
此外,可能存在一些与 SMB/CIFS 安全相关的问题。您可能对计算机的权限、Android 端最终用户的配置复杂性或两者都有问题。只是一个想法!
回答by José Oliveira
You can also use Astro File Manager with the SMB extensions, works for me!
您还可以将 Astro 文件管理器与 SMB 扩展一起使用,对我有用!
Its easy to setup!
它很容易设置!
回答by Jimmy
Samba filesharing app on XDAlets you share Android's 'external' storage device as a Windows/SMB shared folder over wifi, but currently minimum supported Android version is 2.0.1.
XDA 上的 Samba 文件共享应用程序可让您通过 wifi 将 Android 的“外部”存储设备作为 Windows/SMB 共享文件夹共享,但目前支持的最低 Android 版本为 2.0.1。
回答by Jim DiLeo
Use FileLinx Professional from the Android market.
使用 Android 市场上的 FileLinx Professional。
- Total access to PC's "
C
" drive. - Works over Wi-Fi, 3G/4G...connect from anywhere.
- No "Cloud."
- Supports remote printing of most file types to your PC-connected printer.
- PC-side application is Java.
- Supports UPnP for easy port-forwarding.
- Saves settings for up to 10 PC's.
- 完全访问 PC 的“
C
”驱动器。 - 可通过 Wi-Fi、3G/4G...从任何地方连接。
- 没有“云”。
- 支持将大多数文件类型远程打印到与 PC 连接的打印机。
- PC端应用程序是Java。
- 支持 UPnP 以方便端口转发。
- 最多可保存 10 台 PC 的设置。
PC-side application is a free download.
PC端应用程序可免费下载。
回答by Hendy Irawan
If you use i-jetty, you can then share files and web pages (even dynamic servlets!) using HTTP, and browse them from the computer using a normal web browser.
如果您使用i-jetty,则可以使用 HTTP 共享文件和网页(甚至是动态 servlet!),并使用普通 Web 浏览器从计算机浏览它们。
You can still browse them from the device itself, of course. :-)
当然,您仍然可以从设备本身浏览它们。:-)
回答by nont
I don't know of a solution for sharingfiles, but I used AndFTPto copy my ogg music files from my ubuntu box to the sdcard.
我不知道共享文件的解决方案,但我使用AndFTP将我的 ogg 音乐文件从我的 ubuntu 盒子复制到 sdcard。
If by sharing, you just mean "use over the network" you can always put them on a webserver and put the url into android the browser.
如果通过共享,您的意思是“通过网络使用”,您可以随时将它们放在网络服务器上并将 url 放入浏览器的 android 中。
回答by Jay Askren
If you are looking for a solution for your phone, there is at least one samba client in the market. I'm using SambaExplorer and it works quite well. My HTC hero also comes with software from HTC that allows me to hook up my windows machine to my phone so I can move files back and forth.
如果您正在为您的手机寻找解决方案,那么市场上至少有一个 samba 客户端。我正在使用 SambaExplorer,它运行良好。我的 HTC 英雄还附带了 HTC 的软件,它允许我将 Windows 机器连接到我的手机,以便我可以来回移动文件。
From an api perspective, you have access to essentially the same api's you would have in standard Java plus some additional things. See herefor further detail.
从 api 的角度来看,您可以访问与标准 Java 中基本相同的 api 以及一些额外的东西。请参阅此处了解更多详情。