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. Issue with legacy phones URI.


My app needs contacts id, display name and phone number in a single query. I
see legacy uri android.provider.Contacts.Phones.CONTENT_URI suits me the
best. For some reasons query on this uri return me 0.

I looked into the, legacy PHONES table is mapped to a
view (view_v1_phones). I pulled the Contacts2.db and found that
'view_v1_phones' is valid and its listing the data as I needed.

If view_v1_phones is valid, why does my query fails???? Below is the code
snippet I have used...

   Cursor resultPhone =
                                                            null, null,
null, null);
            if(resultPhone != null && resultPhone.getCount() != 0) {
                 //printResults( resultPhone );
            }else {
                if(resultPhone == null)
                    Log.i("suku","cursor null");
                    Log.i("suku","results 0");

Can I get contacts id, display name and phone number in a single query using


2. iPad iMac 360 Degree Stand

LUXA2 (Thermaltsrcake) already had this product on display at CES in
January. It's basically a remarketed version of the stand they created
for the Kindle, which is really a big version of the one for the

Read more :


3. Animation not start immediately when the target view is out of window

4. Service gets killed (due to activity ?)

5. Suasana launching htc desire

6. Sending a route to Google Nav via Intent

7. Share - Samsung jabs iPhone's Retina Display, says AMOLED wins