Android Audio Streaming
<p>Does any one have code they know will run android audio stream from a URL, that will work in android OS 2.2. I have looked on the developer site and there code doesn't seem to work for me. Some of the other code or tutorials are for older versions of android.</p>

<p>This was the code from the code i ve been using(won't work):</p>

<pre><code>import java.io.IOException;

import android.app.Activity;
import android.media.MediaPlayer;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;

public class Radio extends Activity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        // TODO Auto-generated method stub
        super.onCreate(savedInstanceState);
        setContentView(R.layout.radio);
        final MediaPlayer mp = new MediaPlayer();
        try {
            mp.setDataSource(URL);
        } catch (IllegalArgumentException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        } catch (IllegalStateException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        } catch (IOException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        }
        try {
            mp.prepare();
        } catch (IllegalStateException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        } catch (IOException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        }
                // This is code for a button that starts the stream when clicked
        Button bRadio = (Button) findViewById(R.id.button_stream);
        bRadio.setOnClickListener(new View.OnClickListener(){

            @Override
            public void onClick(View V) {



                mp.start(); 
    }






        });





   }
}       
</code></pre>
