How To Use MTP-connected Devices

by Doug Gordon » Thu, 03 Mar 2011 01:48:04 GMT

Sponsored Links
 My app currently requires the user to manually copy certain files from 
their PC to their USB-mounted Android device where my app can open them 
and do its thing. But I'm already running into issues with users' 
devices that want to mount in this "MTP" mode, and I hear that the Xoom 
*only* supports MTP, etc.

So how can MTP be used to transfer files to the device that don't really 
fit into the "Media files" category, and how do I locate the directory 
from my app? What do getExternalStorageDirectory and getExternalFilesDir 
return for a device like the Xoom?

Doug Gordon
GHCS Software


Re: How To Use MTP-connected Devices

by FrankG » Thu, 03 Mar 2011 04:59:35 GMT

 Hi Doug,

I can imagine that this will be more an more a problem for
like yours : You cannot know in which usb mode the target device is
as this is highly vendor/manufacturer specific. You would also run
into trouble
if the user will use pictbridge. And you also not able to trigger a
mode change
because the interface to this is also specific for the manufacturer.

Would be interessted to know whether XOOM only supports MTP, but --
how far I understood Dianne in the past -- it must be at least MTP
otherwise Android Market will not work ?

Good luck !



Sponsored Links

Other Threads

1. Is there a normal human way to copy image from one folder to another?

No. You have to do this all yourself :(

1. Query from the mediastore all the info for your original image,
including its file-path (DATA column).
2. Query from the thumbnail mediastore the info of all the thumbnails
(can have more than one) for the given image.

3. Copy your image-file to another location. Remember this location
for the new DATA column of your new image.

4. Insert into the mediastore all the data obtained from point (1.)
but set your DATA to the new file-path of your new image (from point
5. Insert into the thumbnail mediastore the thumbnails of this new
image. Use the data from point (2.), but update the IMAGE_ID with the
new image-id from point (4.) and make also copies of each thumbnail
file (DATA column).


2. Acivities are getting stacked on top of each other


I have three UI screens A, B and C.
When I click on A it goes to B,
when click on B it goes to C,
again if you click on C it goes to B so this is kind of loop.
I have tried following
EX. B->C->B->C->B->C->B->*C->*
Now I am on Screen C, when I click back it should go to B, again when I
click back it should go to A.

This is not happening the way it is happening is like this, from* C->
click back->*B->*click back->C*->*click back->*B->*click back->*C->*click
back->*B->*click back->C*->*click back->*B->*click back->A

*Please suggest me how to solve this problem.



3. HELP : Magic stuck di bootloader abis restore factory setting..

4. call MediaPlayer.setDisplay between onStop and onStart

5. Butuh Pencerahan + Nasihat.. :(

6. client certificate authentication for ssl/https connection

7. Non-parallel construction of DatePicker and TimePicker