3

I'm trying to create an Android app which streams a radio channel.
This is the link for the radio streaming: mms://89.96.234.34:8000
How can I use this on Android?
This is my MainActivity.java:

public class MainActivity extends Activity {

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_main);
    Uri uri = Uri.parse("mms://89.96.234.34:8000");
    MediaPlayer.create(MainActivity.this, uri).start();
} }

I added: <uses-permission android:name="android.permission.INTERNET"></uses-permission> in the manifest, and when I launch the app I have a null pointer exception on line 16:

        MediaPlayer.create(MainActivity.this, uri).start();
1
  • Do you have the answer to your question ? Do mms urls work with MediaPlayer ?
    – toto_tata
    Commented Feb 19, 2014 at 11:21

1 Answer 1

1

Hello i also have an app like this and i use it like this:

Uri uri = Uri.parse("mms://89.96.234.34:8000");
MediaPlayer.create(MainActivity.this, uri).start();
5
  • Tried that, but I have a Null Pointer Exception on the second line (MediaPlayer.Create ...) should I add something in the activity or in the manifest?
    – Ettore
    Commented Apr 10, 2013 at 9:54
  • Well you need for sure Internet permission in the manifest also can you please post your stacks?
    – user2157571
    Commented Apr 10, 2013 at 13:38
  • Yes, I added the permission, but it doesn't work, I edited my question with code. (can I use MediaPlayer with mms?)
    – Ettore
    Commented Apr 10, 2013 at 13:50
  • i see you added code but i would also like to see the error the Logcat so i can look whats the error
    – user2157571
    Commented Apr 10, 2013 at 16:48
  • I looked in to the logcat the only thing left to try is open the mms with vlc or something similar if that works i dont know man
    – user2157571
    Commented Apr 11, 2013 at 11:36

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.