4

I want to make an Android app that will stream music from my site to all users that use my app. So, my question is, what is better - to get a shoutcast server and stream that to my app (I have to know which song is playing at the moment), or just streaming the music files stored on my server (is this possible?).

Please point me at the right track, and also recommend me some libraries for this purpose (or Android SDK have this).

Thank you.

Vasil
  • 1,073
  • 1
  • 11
  • 11

1 Answers1

1

Try looking at the android.media package from the Android SDK

http://developer.android.com/reference/android/media/package-summary.html

In particular, AsyncPlayer and MediaPlayer classes.

As to whether a Shoutcast server is better than local control of playback (with a playlist for example) is difficult to answer. A Shoutcast server would be a 'single point of failure' if it crashes, i.e., none of the users would get music if that happened. Controlling playback from your app, however, would add a certain amount of extra code in the app (albeit only a small amount).

Squonk
  • 48,735
  • 19
  • 103
  • 135
  • Cool, I've tried MediaPlayer and it works. But for mp3 and some other formats. What about playlist files from online radio stations, like .m3u or .pls? – Vasil Dec 02 '10 at 14:08
  • I've never tried MediaPlayer with playlist files - I expect you'll have to process them yourself and start the next piece of music when the previous one finishes. Implement MediaPlayer.onCompletionListener and provide your own onCompletion(MediaPlayer mp) method. – Squonk Dec 02 '10 at 22:58