Android: Mysterious http connection issue with targetSdkVersion >= 11
<p>Working on an Android library that reads config data from a remote host using HttpClient from two files.  Everything worked fine until I tested it with targetSdkVersion set above 11.  Now the first of the http requests fail with a general exception (I think).</p>

<p>My thought is that the second request interrupts the first somehow, causing it to fail.  But why only in sdk version 11+? </p>

<p>Here is a code snippet of the connection class:</p>

<pre><code>import org.apache.http.client.HttpClient;
public static String readUrl(String url, boolean isCompressed) throws IOException {
    String result = "";

    HttpParams httpParameters = new BasicHttpParams();
    HttpConnectionParams.setConnectionTimeout(httpParameters, 15000);
    HttpConnectionParams.setSoTimeout(httpParameters, 15000);

    HttpClient client = new DefaultHttpClient(httpParameters);
    HttpGet get = new HttpGet(url);
    get.addHeader("Cache-Control", "no-cache");
    if(isCompressed) get.addHeader("Accept-Encoding", "gzip,deflate");

    HttpResponse response = null;
    try {
        response = client.execute(get);
    } catch (ClientProtocolException e) {
        Log.e("debug", "ClientProtocolException HttpClient execute "+e.getMessage());
    } catch (IOException e) {
        Log.e("debug", "IOException HttpClient execute "+e.getMessage());
    } catch (Exception e) {
        Log.e("debug", "Gen Exception HttpClient execute "+e.getMessage());
    }


    result = readResponse(response);        
    client.getConnectionManager().shutdown();
    return result;
}
</code></pre>

<p>The general exception is triggered and e.getMessage() returns null - which is even more confusing.  That is the only error I get.  I've also tried re-writing this with httpURLConnection - same result.</p>

<p>Any ideas?</p>
