tags:

views:

104

answers:

1

I want to play online radio in android application? It can be done RTMP. But i am not aware how to move ahead. Can some one throw light on this?

A: 

i am able to play static mp3 file here s below working code package org.example.video; import android.view.KeyEvent; import android.view.View; import android.widget.VideoView;

import android.app.Activity; import android.content.Context; import android.net.Uri; import android.os.Bundle; import android.widget.VideoView; import android.media.*;

public class Video extends Activity { /** Called when the activity is first created. */ @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); setVolumeControlStream(AudioManager.STREAM_MUSIC);

    Context appContext = getApplicationContext();

    MediaPlayer urlPlayer = MediaPlayer.create(appContext,
    Uri.parse("http://naachradio.com/data/addSound.mp3"));

    urlPlayer.setAudioStreamType(AudioManager.STREAM_MUSIC);


//  urlPlayer.prepare();
    urlPlayer.start();



 }
}
is there a way to stream live audio.the audio is in aacp format