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. help: dont display Toast


I can't display Toast in my application:

I have this code but nothing happens. Any help please?

Many thanks and sorry for my english!

  public void wakeonLan (){

        try {
                         while (pruebaPing(maquina)){
                Toast.makeText(ssh.this, "No responde a ping despues de
mandar el paquete magico en..." + contadorDormido,
                Toast.makeText(getApplicationContext(), "No responde a ping
despues de mandar el paquete magico en..." + contadorDormido,


2. Widgets: Lanscape vs Portrait

I have a 2x1 widget with two textviews, aligned top and bottom to the
baseline, that display fine in Portrait.  When I switch to landscape,
there is insufficient room for the two textviews (the widget becomes
long and narrow) so the two textviews overlap each other.

What is the correct way to handle this?

Do I need a create a 2x1 landscape layout so that Android will use that
specific layout instead of reusing my one layout?  If so, and if that
new layout uses one textview instead of two, how do I know at runtime
which layout is being used?  Or do I keep the code the same and uses the
same IDs on both layouts and updating that second textview id won't hurt

Jake Colman -- Android Tinkerer


3. LVL Retry Count

4. STK Menu

5. Live wallpaper canvas flickers when it includes a bitmap

6. Activity stack with browser and protocol handler

7. Problems with Activity Flow during OAUTH Authentication