Football Fans: Download the 2012 Schedule App from Google Play!


Go Back   Android Forums > Android Development > Application Development > Developer 101

Developer 101 101 Tutorials



Reply
 
LinkBack Thread Tools
Old December 14th, 2011, 02:57 AM   #1 (permalink)
New Member
 
Join Date: Nov 2011
Posts: 6
 
Device(s):
Thanks: 0
Thanked 0 Times in 0 Posts
Default How to get the "MTP mount point" from my Win/Mac app

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

ptaro is offline  
Reply With Quote
Sponsors
Old December 14th, 2011, 03:11 PM   #2 (permalink)
Premium Member
 
Join Date: Oct 2011
Location: Sydney, Australia
Posts: 193
 
Device(s): Galaxy Nexus GSM
Thanks: 2
Thanked 37 Times in 33 Posts
Default

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.
jiminaus is offline  
Reply With Quote
Old December 14th, 2011, 06:41 PM   #3 (permalink)
New Member
 
Join Date: Nov 2011
Posts: 6
 
Device(s):
Thanks: 0
Thanked 0 Times in 0 Posts
Default

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
ptaro is offline  
Reply With Quote
Reply

Bookmarks


Go Back   Android Forums > Android Development > Application Development > Developer 101 User CP
Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -5. The time now is 08:19 PM.
Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2012, vBulletin Solutions, Inc.
Custom vBulletin Skins by: Relivo