B4A Library MtpDevice library - Cameras and media players

The more observant of you will have noticed the presence of a non-functional MtpDevice in the USB library. This library contains an MtpDevice2 object that IS functional. It requires Android 3.1 or later, a device with host mode capable hardware and an OTG cable to connect the MTP device to the Android device.

It allows you to examine the contents of a connected MTP capable device and read data from it. Deleting of objects on the MTP device is possible but adding or modifying them is not possible as the Android MtpDevice API does not possess this capability.

As long as this library works OK the this library will be incorporated into a future issue of the USB library replacing the existing MtpDevice object.
 

Attachments

  • MtpDevice1.0.zip
    24.3 KB · Views: 704

jmon

Well-Known Member
Licensed User
Longtime User
Thank you Agraham for sharing this library.

I see a lot of "get..." commands, but no "send..." commands. How can I do to send a command to the camera or media player? What if I wanted to send a command to release the shutter of the camera? Do I need to do it with AsyncStreams?
 

jmon

Well-Known Member
Licensed User
Longtime User

agraham

Expert
Licensed User
Longtime User
That example you linked to does not use the UsbSerial library (which can control several types of USB to serial adaptors), it uses the standard USB host mode library.

But yes, using that library you would need to write your own routines to control your camera, assuming that it is capable of control over USB and that you have access to the details of the protocol that it implements.
 
Cookies are required to use this site. You must accept them to continue using the site. Learn more…