title: Reading HTML source from android app
body: <p>I'm trying to get the HTML source in a string from a web site that the user enters, the code I have so far looks like this:</p>
  
  <pre><code>public String getURLContent(String url)
  {
      try 
      {
          DefaultHttpClient httpClient = new DefaultHttpClient();
          HttpGet httpGet = new HttpGet(url);
          ResponseHandler&lt;String&gt; resHandler = new BasicResponseHandler();
          String page = httpClient.execute(httpGet, resHandler);
          return page;
      }
      catch (ClientProtocolException e)
      {
          e.printStackTrace();
          return "";
      }
      catch (IOException e)
      {
          e.printStackTrace();
          return "";
      }
  }
  </code></pre>
  
  <p>Every time I try to run this I hit the second catch (IOException), which according to the documentation means the server failed to give a valid response... I am testing this with sites like "http:\www.google.com\", so they should definitely be responding</p>