I decided to start testing my app with Android 4.4 and noticed that the Android HTTP connection APIs are much stricter than before? I have never had this issue and I assume it is some type of bug.
I'm connecting to SHOUTcast broadcasts that contain the particular icy header response.
Has anyone seen this issue? How can I get around it?
URL used for this test:
http://50.117.121.162:80
Logcat of exception:
11-01 23:47:57.299: E/ConnectHelper(3081): java.net.ProtocolException: Unexpected status line: ICY 200 OK 11-01 23:47:57.299: E/ConnectHelper(3081): at com.android.okhttp.internal.http.RawHeaders.setStatusLine(RawHeaders.java:108) 11-01 23:47:57.299: E/ConnectHelper(3081): at com.android.okhttp.internal.http.RawHeaders.fromBytes(RawHeaders.java:308) 11-01 23:47:57.299: E/ConnectHelper(3081): at com.android.okhttp.internal.http.HttpTransport.readResponseHeaders(HttpTransport.java:135) 11-01 23:47:57.299: E/ConnectHelper(3081): at com.android.okhttp.internal.http.HttpEngine.readResponse(HttpEngine.java:644) 11-01 23:47:57.299: E/ConnectHelper(3081): at com.android.okhttp.internal.http.HttpURLConnectionImpl.execute(HttpURLConnectionImpl.java:347) 11-01 23:47:57.299: E/ConnectHelper(3081): at com.android.okhttp.internal.http.HttpURLConnectionImpl.getResponse(HttpURLConnectionImpl.java:296) 11-01 23:47:57.299: E/ConnectHelper(3081): at com.android.okhttp.internal.http.HttpURLConnectionImpl.getResponseCode(HttpURLConnectionImpl.java:503) 11-01 23:47:57.299: E/ConnectHelper(3081): at com.vblast.xiialive.media.streamers.ConnectHelper.connectWorker(ConnectHelper.java:176) 11-01 23:47:57.299: E/ConnectHelper(3081): at com.vblast.xiialive.media.streamers.ConnectHelper.run(ConnectHelper.java:143) 11-01 23:47:57.299: E/ConnectHelper(3081): at java.lang.Thread.run(Thread.java:841)
On Android 4.4 things did change under the hood and the none standard SHOUTcast ICY header response is no longer supported. Just like the Apache HTTPClient library.
What I had to do can be found on this post:
How to parse a none standard HTTP response?
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With