I am querying for Android song data. I have this code
System.out.println("URI COL: " + musicCursor.getString(uriColumn));
Uri uri = Uri.fromFile(new File(musicCursor.getString(uriColumn)));
System.out.println("URI IS: " + uri.toString());
But the output is not right.
URI COL:
/storage/emulated/0/amazonmp3/Red Hot Chili Peppers/Stadium Arcadium/01 Dani California.wma
URI IS: file:///storage/emulated/0/amazonmp3/Red%20Hot%20Chili%20Peppers/Stadium%20Arcadium/01%20Dani%20California.wma
I tried to parse the Uri column and tried the fromFile method but neither option is giving me the format I need.
This answer shows an example of my problem, but no solution.
Uri - content://media/internal/audio/media/29 :: is the format I need.
Path - /system/media/audio/notifications/Ascend.mp3 :: is the format I'm getting.
I only need that format because it appears Android Cursors only work in that format, which is completely illogical, especially when the DATA column only appears to give you the file path.