将文件从Android WPD设备传输到PC [英] Transferring files from Android WPD device to PC

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

问题描述

我的Android应用程序会生成一些文件,这些文件需要与主PC程序同步,反之亦然。我执行此操作的常用方法是使用FTP帐户,我的Android应用程序和PC程序都可以获取文件的最新版本,并且效果很好。我的某些客户端无法在其Android设备上访问互联网,因此必须通过使用USB电缆连接到PC来与我的程序同步。为此,我在PC程序中有一个例程,该例程将同步Android设备上指定文件夹中的文件。问题是该方法仅在将Android设备安装为驱动器并因此由Windows分配驱动器号的情况下才有效。

My Android app produces some files that I need to synchronize with my main PC program and the other way around. The common way I do this is using a FTP account where both my Android app and my PC program gets the latest version of the files, and this works just fine. Some of my clients does not have internet access on their Android devices, and so will have to synchronize with my program by connecting to the PC with a USB cable. For this I have a routine in my PC program that will synchronize the files on a specified folder on the Android device. The problem is that this method only works if the Android device can be mounted as a drive, and thus be assigned a drive letter by Windows.

某些设备,尤其是运行平板电脑的设备Honeycomb(我在Samsung Galaxy 10.1选项卡和Lenovo Thinkpad Tablet上已经体验过)不会作为驱动器安装,而是作为Windows便携式设备(WPD)连接。在这种情况下,我无法从我的程序(用Delphi编写)中访问该设备,因此我的同步文件的例程不起作用。

Some devices, especially tablets running Honeycomb (I have experienced this on Samsung Galaxy 10.1 tab and Lenovo Thinkpad Tablet) will not be mounted as a drive, but instead be connected as a Windows Portable Device (WPD). In this case I cannot access the device from my program (which is written in Delphi) and thus my routine for synchronizing my files does not work.

我的例程必须知道要同步的文件夹的特定位置才能正常工作,因此,如果我可以将文件从设备传输到PC上的临时文件夹,进行同步并有可能将文件传输回设备,那将解决我的问题。

My routine has to know a specific location of the folder to synchronize with to work, so if I could transfer the files from the device to a temporary folder on the PC, synchronize them and possibly transfer the files back on the device, that would solve my problem.

有人可以建议我将WPD设备中的文件传输到PC上的文件夹,然后再传输回来的方法吗?由于我的客户无法手动传输文件,因此它必须是自动化的。另外,是否有一种方法可以强制WPD设备充当普通的外部驱动器并为其分配驱动器号?

Can anyone suggest a way that I can transfer the files from the WPD device to a folder on my PC and back again? It has to be automated as my clients cannot transfer the files manually. Alternatively, is there a way to force a WPD device to function as a normal external drive and be assigned a drive letter?

推荐答案

您可以从PC应用程序中使用 WPD自动化API 。上一页中有可用的文档,尽管我没有寻找任何代码示例。 (我不需要;对于我为Android编写的必须与PC同步的应用程序,这些设备都可以用作USB驱动器,也可以通过Google文档同步(例如,联系人和日历信息)。

You can use the WPD Automation API from your PC application. There's documentation available from the above page, although I haven't looked for any code samples. (I haven't had the need; for the apps I write for Android that have to synch with PCs, the devices all work as USB drives or can synch through Google documents (eg., contacts and calendar info).

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

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