I am doing a streamed musicplayer for android.
I have tried with MediaPlayer
mp.setDataSource("http://www.myServerPage.com/songUrl.mp3");
mp.prepare();
mp.start();
and it works but not good.
The prepare state is very slow and often the application is freezing.
I have searched a lot on forums and tutorials and as far as I can see this is the common way of doing it.
Do anyone know is it is another way of opening up a stream to play music from a server or have any good advices, maybe in NDK or by some other inputstream?
Thanks for the help.
/micke
The Media Playback article is pretty clear about how to deal with remote media sources: call
prepareAsync()and set a listener to get notified when the source is ready for playing.The reason for this is exactly what you’re experiencing:
I suggest you go over the mentioned article for some more information and pointers that may help you with further development.