How can I play a mp3 without download from the url?

realuser picture realuser · Dec 13, 2011 · Viewed 69k times · Source

I want to develop as follows but I did not find good example:

I want to play without having to download an mp3 encoding in the url. Unless the user stops it the mp3 should play in the background. I guess I do multitasking.

Is there an example document or any advice please. Thanks.

Answer

user370305 picture user370305 · Dec 13, 2011

Look at these two tutorials, In these the .mp3 files are playing through web url,

Example of streaming mp3 mediafile from URL with Android MediaPlayer class

Play Mp3 file from a Url

Also if you want to play .mp3 file in background I think you have to use Service and AIDL for it,

Look at basic Android-Music Player demo MusicDroid - Audio Player Part II it describe how to use Service and AIDl for your Audio Player.

Thanks..