I have tried the code on the emulator using Platform 2.2 API level 8 as
well as an Emulator using Platform 4.0.3 using API level 15 .. it works
perfectly and starts the stream in about 5 secs. But when i run the code on
my HTC one x (Android Version 4.0.3)or tried running it on the HTC Desire
S(Android Version 2.3.5) it takes over 50 secs to stream
Here is my code
public static MediaPlayer mp;
public String url = "http://vprbbc.streamguys.net:80/vprbbc24.mp3";
public void onCreate(Bundle savedInstanceState) {
mp = new MediaPlayer();
try {
mp.setDataSource(url);
mp.setOnErrorListener(this);
mp.setOnPreparedListener(this);
mp.prepareAsync();
}
catch(IOException e){
e.printStackTrace();
}
} // close of onCreate
public void onPrepared(MediaPlayer player) {
mp.start();
There is no issue with the internet connection. Both the phone and the emulator
are connected to the same internet connection.
I have also tried running the code on a samsung tab and the streams starts up
in roughly 6 secs.
--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en