Android's mediaplayer api supports streaming .pls file, but the API is not the best option, and the documentation is not very good. The life cycle diagram provided in the official documentation provides valuable information, but can be confusing at first glance.
Example code snippet:
MediaPlayer mp; mp=MediaPlayer.create(getApplicationContext(),Uri.parse(url)) Example url of .pls file http://50.xx.xxx.xx:xx40/) mp.start(); mp.pause(); mp.release() (or mp.reset() as applicable)
http://developer.android.com/reference/android/media/MediaPlayer.html#create(android.content.Context , android.net.Uri)
There are listeners / callbacks in the MediaPlayer api, but for application developers working with audio streaming, it's really problematic.
A static constructor used in the code snippet / best approach for creating a media object with a URI (for example, http-url with host and port) is proposed. But the callback functions cannot be used by the developer, because the preparation is called by the constructor itself.
The created object can be played / stopped in the asyn stream (AsyncTask api).
The official documentation on android does not give any "method of obtaining" to get the status of a media player.
I welcome Android app developers to talk about this;
and I want the framework developers to provide more accurate documentation - how much it supports or what the relevance and vision of the Google Inc and Android development team are in the Mediaplayer API for streaming audio with URLs.
If someone needs help from me or share your experience, let me talk about MediaPlayer api for audio streaming @ /fooobar.com / ... or the Android developers blog (android-developers.blogspot.com).
Relationship Sri Ramakrishna Program Manager and Android Developer @New Mek Solutions, Hyderabad.