Transfer files from an Android WPD device to a PC

My Android application creates some files that I need to sync with my main PC program, and vice versa. The usual way I do this is to use an FTP account, in which both my Android app and my computer program receive the latest version of the files, and this works just fine. Some of my clients do not have Internet access on their Android devices, so I will have to synchronize with my program by connecting to my PC using a USB cable. To do this, I have a program in my PC program that will synchronize files in the specified folder on the Android device. The problem is that this method only works if the Android device can be installed as a drive and thus it will be assigned the drive letter of Windows.

Some devices, especially Honeycomb-enabled tablets (I tested this on the Samsung Galaxy 10.1 tab and Lenovo Thinkpad), will not be mounted as a drive, but instead will 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 therefore my program for synchronizing my files does not work.

My routine needs to know the specific location of the folder to synchronize with it, so if I can transfer files from the device to a temporary folder on the PC, synchronize them and possibly transfer the files back to the device, which will solve my problem.

Can anyone suggest a way to transfer files from a WPD device to a folder on my PC and vice versa? It needs to be automated, as my clients cannot transfer files manually. Alternatively, is there a way to make the WPD device function like a regular external drive and assign a drive letter?

+7
source share
2 answers

You can use the WPD Automation API from your PC application. There is documentation available on the above page, although I have not looked for code samples. (I had no need; for the applications I write for Android that need to sync with a PC, all devices work as USB sticks or can sync Google documents (e.g. contacts and calendar information).

+2
source

One way to do this is to go here and see the "adb push" and "adb pull" commands, this should work because the Android device is connected via USB, but you need to download the SDK and get the files you need as a "special cocktail application", which you will give to customers so that synchronization works. Hope this helps!

0
source

All Articles