I have a radio app for my website working in my EVO and other devices that works great, but a user tells me that in his Samsung Galaxy S it freezes the app (he send me a video in witch I can see that the media player service gets call and starts, but no sound comes out and the app freezes no crash screen to send a report or nothing it just freezes), I don't have a Galaxy to test on, so what can I do? have anyone else had a similar problem? I try pasting my code here but someone decided to close my question with out any suggestions. all my app does is from the main activity a button calls the media player adds the url of my mp3 stream and starts the payer.
Button canal1 = (Button) findViewById(R.id.bcanal1);
canal1.setOnClickListener(new View.OnClickListener() {
public void onClick(View view) {
mUrl = "http://67.212.165.106:8161";
textRadioName.setText("you are listening to VARIADO!");
Intent i = new Intent (ChevereMovilActivity.this, PlayerService.class);
startService(i);
PlayerService.setSong(mUrl, "Temp Song", null);
start();
}});
start method
@Override
public void start() {
if (PlayerService.getInstance() != null) {
PlayerService.getInstance().startMusic();
}
}
in the manifest
<service android:name=".PlayerService"
android:label="@string/app_name">
<intent-filter>
</intent-filter>
</service>
like I said it works in my eve but not a Samsung Galaxy S I'm using Android 2.2
The service is frozen because Samsung Galaxy S can't prepare the stream and you are probably using mediaPlayer.prepare() instead of mediaPlayer.prepareAsync().
I think it's an undocumented "quirk" in some Galaxy devices. The problem is the stream format. If you write in a console:
wget -S -O stream http://67.212.165.106:8161
and them:
head -n 12 stream
you can see something like:
ICY 200 OK
icy-notice1:<BR>This stream requires <a href="http://www.winamp.com/">Winamp</a><BR>
icy-notice2:SHOUTcast Distributed Network Audio Server/Linux v1.9.8<BR>
icy-name:My Station name
icy-genre:Various
icy-url:http://www.radiokolergan.com
content-type:audio/mpeg
icy-pub:1
icy-br:64
qOCéúÐX43‘¤]ÝáÅQ(;Œ6½v<‡ÿò„
I think the problem is this header. If you try with others urls (for example: http://195.55.74.213/rtve/radio4.mp3?GKID=804c9f24cb4811e1af4600163ea2c743
) you doesn't obtain this header and it reproduce fine in Samsung Galaxy Tab and other devices.
http://67.212.165.106:8161
doesn't work for me when I have the WiFi on. I will continue researching the problem. If I find something new I will edit the answer - Brais Gabin 2012-07-13 09:13