Android 4.4 http api bugs?

风流意气都作罢 提交于 2019-12-01 02:58:19
Jona

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?

Jona answer is right, but if you are using AACPlayer(https://code.google.com/p/aacplayer-android/) to play your SHOUTcast, here is a simpler solution: https://code.google.com/p/aacdecoder-android/wiki/HandlingShoutcastStreams

Also, I needed to change my url from "http://example.org" to "icy://example.org"

I've implemented a solution based on the Apache HttpClient, you can find it as a gist here.

Here is how to use it:

IcyGetRequest request = new IcyGetRequest(urlStr);
HttpResponse response = request.get();
int responseCode = response.getStatusLine().getStatusCode();
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!