title: Create a synchronize HTTP GET request in Android
body: <p>I am trying to get some text via HTTP GET and display it to the UI. I do not need an async task (i.e, the user have to wait until I get the text completely).</p>
  
  <p>I tried this in main thread</p>
  
  <pre><code>try {
      String url = URL_HERE; 
      HttpGet httpget = new HttpGet (url);
      ResponseHandler&lt;String&gt; responseHandler = new BasicResponseHandler();
      text = Client.execute(httpget, responseHandler);
  }
  catch(Exception ex) {
      text = ex.getLocalizedMessage();
  }
  </code></pre>
  
  <p>But I always see an exception.
  I just need a simple mechanism to get the text. Could you suggest?</p>
  
  <p>Thank you very much,</p>