I need to download an mp3 file from my firebase storage gs://fir-b9532.appspot.com/songs/song1.mp3 and play it into my android application. I want to store the mp3 file temporar
This line isn't doing at all what you expect:
MediaPlayer md = MediaPlayer.create(MainActivity.this,R.id.bytes);
R.id.bytes
is an id resources called bytes
. It contains an integer. It's not the array of bytes that you're receiving in your success listener.
Bear in mind also that MediaPlayer can't play media that exists in an array of bytes. You'll have to instead save the array of bytes to a file, and point MediaPlayer to that file for playback with create(Context context, Uri uri). Then you should probably delete the file when you're done.