If I understand correctly, what you are calling "external" USB path is actually the mount point for your SD card on your computer. Most likely, your SD card has label userdata1
. Therefore when it's mounted on the computer, it gets /mnt/userdata1
mount point. However this is not strictly necessary and it can be any mount point at all. In fact, if you connect it to another computer, it can easily be another mount point.
Because this path is determined by the computer operating system, you'll need to find this path on your computer (note that this can be different every time you connect your phone to your PC, so you'll need to do it every time).
From your question and path structure (/mnt/userdata1
) I'm guessing you're using linux or some other unix version. Therefore you could run mount
on your PC to see the list of the mounted devices. For example, here's the output on my mac:
$ mount
/dev/disk0s2 on / (hfs, local, journaled)
devfs on /dev (devfs, local, nobrowse)
map -hosts on /net (autofs, nosuid, automounted, nobrowse)
map auto_home on /home (autofs, automounted, nobrowse)
/dev/disk1s1 on /Volumes/ALEKS540 (msdos, local, nodev, nosuid, noowners)
Note the last line in the output - this is my connected android phone with the SD card mounted to the computer. On macs, the mount points are created under /Volumes
instead of /mnt
. Other than than, ALEKS540 is the label of my SD card, hence it's mounted this way.
Internally on the phone, it's still mounted as /mnt/sdcard
.
From the point of view of Android, there may be three storage types:
- Internal memory it's always mounted under
/
on the device and contains everything except the SD card and USB storage below.
- SD card - this is referred to as "external storage" and is usually mounted as
/mnt/sd
, but not always. Environment.getExternalStorageDirectory()
will return the path of SD card mount point.
- USB storage - this is only supported on very few devices (those that support USB host mode for external storage). This will be mounted somewhere under
/mnt
, but the exact location will vary. You will need to use Android NDK to interrogate and iterate mounted devices to find the one you're after.