Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Transferring files from Android WPD device to PC

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.

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.

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.

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?

like image 752
Daniel Avatar asked Nov 22 '11 22:11

Daniel


1 Answers

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).

like image 178
Ken White Avatar answered Sep 21 '22 21:09

Ken White