How to transfer file to connected MTP device?

61 views
Skip to first unread message

G. Gowtham

unread,
May 6, 2016, 10:40:13 AM5/6/16
to android-platform
Hi,

I am writing an application using API's provided under android.mtp packages to perform file transfer between android device and other USB device with only MTP support. 
I am able to read the contents from the MTP device to my android device successfully using importFile() function provided under MtpDevice class.

My questions are!
How to write file to the MTP device from my android's storage?
Does Android's USB host mode support this write functionality to the connected MTP devices?

And I looked into the source code given under mtp in AOSP. There are two functions given under MtpDevice class SendObjectInfo and SendObject. Can this functions be used to perform the file transfer?

Thanks,
Gowtham G
Reply all
Reply to author
Forward
0 new messages