I am trying to connect an android device to a (Windows 7 64bit) PC via cable, and then to retrieve some files from android to pc programmatically.
(Note: I need this for a specific device, Moverio BT-200, and I am having drivers issues with that; so please don't suggest to use adb ;-) I know that's the easy and fast way, but it's not feasible)
I have found that my device can be seen as a Windows Portable Device (WPD). I found some really good code examples in C# that enables me to detect WPDs, to enumerate their contents, and to transfer the contents. I also found some code in C++, which does all of the above and much more. All of this examples works like a charm as long as I connect a single sdcard, or a usb key (that is: as long as I have a device which gets recognized by Windows and gets a letter as a proper drive), and I get a full list of the present files, with their absolute paths. However, if I try to connect an android devices, and to list the contents, I get something that I do not understand:
embt2
SD Card
o15F9A
o15F9B
o15F9C
o15F9D
o15F9E
...etc
Internal Storage
o1
o2
o3
o4
o5
o6
oD1F
oD20
oD24
o7
o8
o1E78
o9
...etc
How can that be? Browsing the C# code (second link, above), I found that at some points, the code creates several GUID objects, each with some slightly different parameters:
// Identify the property to retrieve
var property = new _tagpropertykey();
property.fmtid = new Guid(0x26D4979A, 0xE643, 0x4626, 0x9E, 0x2B,
0x73, 0x6D, 0xC0, 0xC9, 0x2F, 0xDC);
property.pid = 12;
[...]
// Get the name of the object
string name;
var property = new _tagpropertykey();
property.fmtid = new Guid(0xEF6B490D, 0x5CD8, 0x437A, 0xAF, 0xFC,
0xDA, 0x8B, 0x60, 0xEE, 0x4A, 0x3C);
property.pid = 4;
[...]
// Get the type of the object
property = new _tagpropertykey();
property.fmtid = new Guid(0xEF6B490D, 0x5CD8, 0x437A, 0xAF, 0xFC,
0xDA, 0x8B, 0x60, 0xEE, 0x4A, 0x3C);
property.pid = 7;
[...]
var folderType = new Guid(0x27E2E392, 0xA111, 0x48E0, 0xAB, 0x0C,
0xE1, 0x77, 0x05, 0xA0, 0x5F, 0x85);
var functionalType = new Guid(0x99ED0160, 0x17FF, 0x4C44, 0x9D, 0x98,
0x1D, 0x7A, 0x6F, 0x94, 0x19, 0x21);
But I couldn't figure out how these exadecimal values work. The documentation online seems scarce. I found my device guid with the Device Manager ({eec5ad98-8080-425f-922a-dabf3de3f69a}
), but everytime I tried to replace one of these guid with my own, I got a COMException.
Am I looking in the right place? Do I need to set some GUID, or something else?
I am tagging this question as C# and C++ because I found some code examples in these two languages, but I am willing to solve the problem in any language (java, python, ... )