从保存的Andr​​oid设备文件到windows编程 [英] Save file from android device to windows programmatically

查看:193
本文介绍了从保存的Andr​​oid设备文件到windows编程的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有什么办法来保存从Android应用程序创建一个USB连接Windows PC上的文本文件编程?

Is there any way to save a text file created from an android app to a USB connected windows PC programmatically?

推荐答案

简短的回答 - 不,我知道

Short answer - not that I know of.

对于一般的文件传输,我肯定会看两个 Dropbox的(保存/同步什么任何事情,任何地点)和 ESFileExplorer 。两者都是面向用户,但Dropbox的有你的的能够与Android使用(我还没有尝试过)的API。 ESFileExplorer适用于USB和Windows共享。

For "file transfer" in general, I would definitely look at both Dropbox (save/synch anything to anything, anywhere) and ESFileExplorer. Both are user-oriented, but Dropbox has an API that you should be able to use with Android (I haven't tried it). ESFileExplorer works with both USB and Windows shares.

如果你有Android SDK中,您可以从亚行拉命令行复制文件。当然,你可以从Java调用亚行拉有的Runtime.exec()。丑陋...但-能:)

If you have the Android SDK, you can copy files from the command line with "adb pull". And of course you can invoke "adb pull" from Java with "Runtime.exec()". Ugly ... but do-able :)

另外一种可能性为Windows共享可能是:

One other possibility for Windows shares might be:

一)获取的SMB客户端(例如,的桑巴文件共享),然后

a) Get an SMB client (for example, Samba Filesharing), then

b)利用标准的Java IO读取和写入和共享

b) Use standard Java IO to read and write to and from the share

同样,我还没有试过这个...我不知道它是否会工作...但它的可能的是值得一试。我看不出在出现使用Samba文件共享根本不相容的Andr​​oid文件I / O什么:

Again, I haven't tried this ... and I don't know if it would work ... but it might be worth a shot. I don't see anything in Android File I/O that appears fundamentally incompatible with Samba file sharing:

  • http://developer.android.com/reference/java/io/File.html

这篇关于从保存的Andr​​oid设备文件到windows编程的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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