James
James

Reputation: 14121

I want to load an mp3 from a string path in android?

I want to load an mp3 from a string path in android which is situated in drawable folder? Please anyone help me on this.

Upvotes: 0

Views: 247

Answers (2)

MGK
MGK

Reputation: 7098

If you add your mp3 file into android assets folder Url of your file would be file:///android_asset/yourfile.mp3

Upvotes: 0

benvd
benvd

Reputation: 5784

If you put the file in your assets folder, you can easily access it using ContextWrapper#getAssets().open(fileName).

Upvotes: 1

Related Questions