Windows MTP/WPD communication with Android device

giZm0 picture giZm0 · Oct 27, 2011 · Viewed 7.4k times · Source

I'm developing a PC c++ application running on windows. The application shall communicate with an android phone connected thru USB, using MTP. The idée is to not mount the Storage Card. What I have found is that Windows have something they call WPD (Windows Portable Device ) which supports MTP. It looks pretty ok but it demands WMP11 to be installed. What I wondering:

  • Is there are any other alternatives libraries you can use?
  • Do any one have any tips or experience about using WPD?
  • Are there any "leaner" dependencies you can install instead of WMP11 for xp?

Any help would be greatly appreciated.

Answer

giZm0 picture giZm0 · Jan 17, 2012

I here provide some answers to my question for the hope that it will help some one else.

Is there any alternatives/leaner libraries?

  • You can use WIA but that is only used for images. but a part from that I have not found any.

Any tips?

  • Check out the sample code provided by Microsoft, it is a good start point. I found it be searching for Portable Devices COM API Sample on MSDN
  • For Services you can check out this sample code. Which I found by googling for WpdServicesApiSample
  • The WPD api is pretty ok to use.
  • Not all devices support MTP and some only support part of it. This caused me some problem but the device we used released an update which supported more of MTP
  • I found the answer about XP-problems from this StackOverflow by pcbbc really helpful. I can also add that we mailed the supplier and asked for a custom .INF file to support XP and they were really helpful and provided us with it. But it took some time before we got it.