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. Froyo Wi-Fi hotspot mode and server apps

How do I find the IP address of my Android device when it is in
Froyo's Wi-Fi hotspot mode? My Ubuntu netbook finds the SSID:
AndroidAP. When I connect to Froyo's DHCP server it assigns my netbook
an IP address of Broadcast Mask

If I run a server app on my Android -- say an FTP server for instance
--, what IP address would I give the client running on my netbook?

I would hope that Froyo supports server apps in Wi-Fi hotspot mode the
same way as it supports server apps in Wi-Fi DHCP client mode. Does
it? How is it supported in the SDK? We can change the SSID and
security. Can we change the broadcast channel?

h...@louie-ux:~$ iwconfig wlan0
wlan0     IEEE 802.11bg  ESSID:"AndroidAP"
          Mode:Managed  Frequency:2.437 GHz  Access Point:
          Bit Rate=24 Mb/s   Tx-Power=20 dBm
          Retry  long limit:7   RTS thr:off   Fragment thr:off
          Power Management:off
          Link Quality=70/70  Signal level=-37 dBm  Noise level=-95
          Rx invalid nwid:0  Rx invalid crypt:0  Rx invalid frag:0
          Tx excessive retries:0  Invalid misc:0   Missed beacon:0


2. No value being returned with ksoap calling web service

I have a .Net Web Service which returns a single integer value. When i
call upon it from my application, no value is returned. Nothing at all
really happens. I set up breakpoints and watched it's progress and it
seems the problem is coming from when i get to this line:, envelope);

I have a hunch that my URL string is the problem. I've tried replacing
the "localhost" in my URL string with my local and network ip with no
luck. Whenever i replace the localhost with the ip in my browser i get
Server Cannot Access or Unable to Connect pages. Does anyone know a
solution to this problem?

Here's my class calling my web service:

public class CGCountTest extends Activity {

        TextView testTV;

        private static final String NAMESPACE = "
        private static final String URL = "http://localhost:11746/
        private static final String SOAP_ACTION = "http://www.passport-";
        private static final String METHOD_NAME = "getCGCount";

    public void onCreate(Bundle savedInstanceState) {

        TextView testTV = (TextView)findViewById(;

              SoapObject request = new SoapObject(NAMESPACE, METHOD_NAME);
                SoapSerializationEnvelope envelope =
                        new SoapSerializationEnvelope(SoapEnvelope.VER11);
                        envelope.dotNet = true;
                        HttpTransportSE androidHttpTransport = new

                        try {

                                String resultData = result.toString();
                        catch(Exception e)


3. LinkedIn Oauth authentication

4. Augmented Reality framework to display geoloc point

5. Cara menghilangkan jam di toolbar atas

6. Android 2.2 prevents some apps from dis playing in the Market 鈥?Android and Me

7. Focus rect in home widgets (aka launcher widgets)