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. imagebutton pressed image not showing ?

<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="">
        <item android:drawable="@drawable/image1" /> <!-- default -->
        <item android:state_pressed="true" android:drawable="@drawable/
image2" /> <!-- pressed -->
        <item android:state_focused="true" android:drawable="@drawable/
image3" /> <!-- focused -->

i wrote this in btnattr.xml file in drawale.

and in my main.xml i wrote
<ImageButton android:id="@+id/ImageButton09"
                        android:layout_width="80px" android:layout_height="80px"

when the application is run, the image1 is displayed, expected.

but when i press the button image2 is not displayed ! where am I going
wrong ?

Thanks for helping



2. trouble installing SDK


Having a bit of trouble installing the Android Plugin for Eclipse (ADT). I
have followed the steps as per the guide, and everything seems to work fine
up until Eclipse restarts.

When I go to 'windows\preferences' to configure the path of the SDK, I cant
see any link for Android.
When I check under 'help\software updates\manage configuration' I see two
strange things:
1) Under 'eclipse platform' I have 2 links to the exact same path
2) When I open either of the above paths, I see a list of packages
(including Android), but with red crosses (indicating disabled?)

Any advice on how to get around this problem?


3. Finding out which version of Andriod is running on a phone.

4. Fwd: Info required on call to onLocationChanged() functionality.

5. resources variable

6. How to use GPS receiver in Gphone

7. Long boot for emulator.. avoid restart?