Android 4.4 http api bugs?

后端 未结 3 1694
旧时难觅i
旧时难觅i 2021-01-11 12:35

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

相关标签:
3条回答
  • 2021-01-11 12:36

    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?

    0 讨论(0)
  • 2021-01-11 12:42

    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();
    
    0 讨论(0)
  • 2021-01-11 12:57

    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"

    0 讨论(0)
提交回复
热议问题