I want to download audio file from url and play that audio file in my device.how to implement this concept in my application.please help me
Thanks Friends
Try below code:-
private void PlayFile() {
try {
mp.reset();
Uri uri = Uri.parse("http://soundcloud.com/storynory/the-valentine-witch-mp3/download.mp3");
mp.setDataSource(this, uri); // "this" refers to context
mp.prepare();
mp.start();
} catch (Exception e) {
// TODO: handle exception
e.printStackTrace();
}
}
If you are required "Download MP3" code then i will post that code also.