Here’s a question I had stumbled upon a few days ago.
The question is asking for how the method, “load(String path, int priority)” should be used, and what syntax the “path” variable should be like. Unfortunately, all the answers to that question gives incorrect answers. None of them mentions the use of the “load(String, int)” method, and none of them even answers what “path” should look like.
I’m unable to come up with a solution to this. Could anyone help out?
The path is just the path of the file in the android filesystem.
For example, If I drag/drop
foo.mp3to my android filesystem, it gets placed at/mnt/sdcard/foo.mp3I would pass/mnt/sdcard/foo.mp3to the load method.The base path (
/mnt/sdcard/) may vary from phone to phone, so you can query it withEnvironment.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.