As the title says, I'm basically wondering if the MediaPlayer streaming support works for all versions of Android.
Here is the code I'm currently using, which works fine on my Android 2.2 phone:
MediaPlayer mp = new MediaPlayer();
mp.setDataSource(SHOUTCAST_STREAM);
mp.prepare();
mp.start();
But will that work on say 1.5 or 1.6? Or would I have to build my own buffering management system for the stream?
* Update *
Just tested it on the 1.6 emulator, and getting the following errors. On the 2.2 emulator it works fine.
23:15:50.074 31 ERROR PlayerDriver Command PLAYER_INIT completed with an error or info PVMFFailure
23:15:50.074 282 ERROR MediaPlayer error (1, -1)
23:15:50.074 282 ERROR MediaPlayer io error
23:15:50.074 282 ERROR MediaPlayer java.io.IOException: Prepare failed.: status=0x1
23:15:50.074 282 ERROR MediaPlayer at android.media.MediaPlayer.prepare(Native Method)
23:15:50.074 282 ERROR MediaPlayer at org.me.bla.Bla.onCreate(Bla.java:38)
23:15:50.074 282 ERROR MediaPlayer at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1123)
23:15:50.074 282 ERROR MediaPlayer at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2364)
23:15:50.074 282 ERROR MediaPlayer at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2417)
23:15:50.074 282 ERROR MediaPlayer at android.app.ActivityThread.handleRelaunchActivity(ActivityThread.java:3502)
23:15:50.074 282 ERROR MediaPlayer at android.app.ActivityThread.access$2200(ActivityThread.java:116)
23:15:50.074 282 ERROR MediaPlayer at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1798)
23:15:50.074 282 ERROR MediaPlayer at android.os.Handler.dispatchMessage(Handler.java:99)
23:15:50.074 282 ERROR MediaPlayer at android.os.Looper.loop(Looper.java:123)
23:15:50.074 282 ERROR MediaPlayer at android.app.ActivityThread.main(ActivityThread.java:4203)
23:15:50.074 282 ERROR MediaPlayer at java.lang.reflect.Method.invokeNative(Native Method)
23:15:50.074 282 ERROR MediaPlayer at java.lang.reflect.Method.invoke(Method.java:521)
23:15:50.074 282 ERROR MediaPlayer at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:791)
23:15:50.074 282 ERROR MediaPlayer at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:549)
23:15:50.074 282 ERROR MediaPlayer at dalvik.system.NativeStart.main(Native Method)
So does this mean it just simply doesn't work on on the older versions of the OS, or is there any work around? I guess I could just do a custom buffering system, but I want to make sure there isn't an easier way first.