title: How to handle HTTP timeout?
body: <p>In my application, I am downloading JSON data from a ReST web service. Most of the time, this works fine, however sometimes the connection will time out.</p>
  
  <p>This is the code I use to set the timeout...</p>
  
  <pre><code>HttpConnectionParams.setConnectionTimeout( httpParameters, 20000 );
  HttpConnectionParams.setSoTimeout( httpParameters, 42000 );
  </code></pre>
  
  <p>If the connection times out, the application crashes and closes, how do I handle a time out?</p>