title: Sporadic UnknownHostException on Samsung Galaxy S II
body: <p>In testing an app, I keep getting errors that occur sporadically on only one device: the GT-I9100 (European) Samsung Galaxy S II. These errors do not occur on any other device, not even the SPH-D710 (Sprint) Samsung Galaxy S II.</p>
  
  <p>The URLs used by the app do not change. They are the same that I can type into a web browser, or that the iOS and desktop versions of the app use. But sometimes they throw an UnknownHostException, and sometimes they don't.</p>
  
  <p>Here is a heavily sanitized version of the code I am using:</p>
  
  <pre><code>AndroidHttpClient client = AndroidHttpClient.newInstance(activity.getString(R.string.user_agent));
  HttpPost httpPost = new HttpPost("http://" + subdomainId + ".website.com/doSomething.aspx");
  
    try {
      // Add your data
      List&lt;NameValuePair&gt; nameValuePairs = new ArrayList&lt;NameValuePair&gt;();
      nameValuePairs.add(new BasicNameValuePair("parameter1", value1));
      nameValuePairs.add(new BasicNameValuePair("parameter2", value2));
      httpPost.setEntity(new UrlEncodedFormEntity(nameValuePairs));
  
      // Execute HTTP Post Request
      HttpContext httpContext = new BasicHttpContext();
      HttpResponse response = client.execute(httpPost, httpContext);
  
    ... ...
  </code></pre>
  
  <p>Is there any quirk of the Samsung Galaxy S II that could be causing this? It's running Android 2.3.6.</p>