1. Download our Official Android App: Forums for Android!

Apps How to get the "MTP mount point" from my Win/Mac app

Discussion in 'Android Development' started by ptaro, Dec 14, 2011.

  1. ptaro

    ptaro Lurker
    Thread Starter
    Rank:
    None
    Points:
    5
    Posts:
    6
    Joined:
    Nov 9, 2011

    Nov 9, 2011
    6
    0
    5
    Hi all,

    How do I get the "MTP mount point(Android device)" from Win/MAC application when I connect Android device by USB cable?

    Although i checked the API, I cannot find it :-(

    -----
    Android ; ver3.0 and up.
    PC : Win XP/Mac OS X

    Thanks
    ptrao
     

    Advertisement

  2. jiminaus

    jiminaus Well-Known Member
    Rank:
    None
    Points:
    63
    Posts:
    190
    Joined:
    Oct 27, 2011

    Oct 27, 2011
    190
    36
    63
    Sydney, Australia
    On Mac OS X, there is no mount point. Mac OS X doesn't have native support for MTP. A Mac OS X user needs to use the Android File Transfer app. If you want to communicate with an Android 3.0+ device from a Mac OS X app, you'll need to provide your own MTP host. DoubleTwist doesn't work with Android 3.0+ devices over USB, probably for this very reason.

    Under Windows, MTP devices are also not exposed in the regular filesystem. Normally you can drag and folder from Windows Explorer into Command Prompt to get the path of a folder, but Command Prompt won't accept folders from MTP devices. It's been a very long time since I've done Windows programming, and I'm not about to start again. But I think you'd have to look not at the Android API for this, but the Win32 API. Perhaps there is a device enumeration API that you can you to find the Android device, and from there get access to an API with which you can use to transfer files.
     
  3. ptaro

    ptaro Lurker
    Thread Starter
    Rank:
    None
    Points:
    5
    Posts:
    6
    Joined:
    Nov 9, 2011

    Nov 9, 2011
    6
    0
    5
    Hi,

    Thank you for your reply. It's OK.

    BTW, I have a question.(change question)

    How do I get "MTP mount path(Android device)" from my Android app?
    For example, "/sdcard", "/sdcard2" and so on.

    Almost MTP mount path is "/sdcard", but these mount point path are different from each device manufacturer.
    So, I need to know the MTP mount path from my android app in order to put files to MTP mount path.

    Are there any way to get MTP mount path from my Android app?

    Thanks,
    ptaro
     

Share This Page

Loading...