title: How should I handle server timeouts and error code responses to an http post in Android App?
body: <p>My Android App does http posts to URLs like <a href="http://example.com/abc.php?email=abc@xyz.com" rel="noreferrer">http://example.com/abc.php?email=abc@xyz.com</a>
  So the Android App basically talks to PHPs on the server side and receives JSON responses and parses them to populate various views in the App. Works fine.</p>
  
  <p>My question is- How should I handle events below in the Android App so that in case these events occur in the server side application, the App should not FORCE CLOSE as it does now.</p>
  
  <ol>
  <li><p>Server Time out occurs and no response is received. The App force closes now. I want to handle this appropriately.</p></li>
  <li><p>Error Codes returned as a response to the App http post to the server. The App Force closes currently since I have not handled this. </p></li>
  </ol>
  
  <p>I have encountered these two scenarios where the App is not coded to handle these events. Please feel free to add any other events that might occur that might lead ANRs occur in Android App.</p>
  
  <p>A little code snippet or clue will help me a lot since I have never done this before.</p>
  
  <p>Thanks.</p>