The path is just the path of the file in the android filesystem.
For example, If I drag/drop foo.mp3
to my android filesystem, it gets placed at /mnt/sdcard/foo.mp3
I would pass /mnt/sdcard/foo.mp3
to the load method.
The base path (/mnt/sdcard/
) may vary from phone to phone, so you can query it with Environment.getExternalStorageDirectory()
.
As far as I know it's not to be used with resources, but rather just files in your filesystem.
Also, should probably include this note from Android docs, so that the "sdcard" is not confusing. My phone does not even have an external sdcard, but all the files in my android filesystem get placed in the /sdcard/ folder, I have no idea why.
Note: don't be confused by the word "external" here. This directory can better be thought as media/shared storage. It is a filesystem that can hold a relatively large amount of data and that is shared across all applications (does not enforce permissions). Traditionally this is an SD card, but it may also be implemented as built-in storage in a device that is distinct from the protected internal storage and can be mounted as a filesystem on a computer.