title: Android - Periodically HttpClient timeout occurs
body: <p>Hi I already asked this questions, but this time I check that method to allow all certificate is not causing issue.</p>
  
  <p>I develop an app which is also on iPhone. Problem is with api requests. I setup the timeouts for all requests. Sometimes it occurs kind a breaks from 30 - 60 second. It looks like this that app does couple request and than break, all the time timeouts, after about 45 second everything ok.</p>
  
  <p>I don't know if this is server issue or android.</p>
  
  <p>This problem doesn't occur on iPhone with IOS 5, but also apear on IOS 4.</p>
  
  <p>I check for HttpClient and also fot HttpsURLConnection.</p>
  
  <p>Connection is https, also was trying directly IP address.</p>
  
  <p>All request has the same problem, all request are in async tasks. </p>
  
  <p>All them looks the same:</p>
  
  <pre><code>DefaultHttpClient client = new HttpSupport().getNewHttpClient();
  
      client.getCredentialsProvider().setCredentials(new AuthScope(AuthScope.ANY_HOST,AuthScope.ANY_PORT),new UsernamePasswordCredentials(user, pass));
  
      HttpGet httget = new HttpGet("xxxxxxxxxxxxxxxxxxxxxxx");
      httget.setHeader("Accept", "application/json");
  
      HttpResponse respond = null;  
  
      try 
      {
          respond = client.execute(httget);
      } 
      catch (ClientProtocolException e) 
      {
          Log.e(TAG,"getEvents, ClientProtocolException");
      } 
      catch (IOException e) 
      {           
          Log.e(TAG,"getEvents, IOException: " + e.getMessage());
      }
  </code></pre>
  
  <p>The code dor my HttpSupport class is in my prev question : <a href="https://stackoverflow.com/questions/9716902/android-api-requests">Android - API Requests</a></p>
  
  <p>It is can be the server fault? 
  Thank you for any help.</p>
  
  <p>Recently I notice that app is hang on client.execute... try to do like this: <a href="https://stackoverflow.com/questions/9505358/android-httpclient-hangs-on-second-request-to-the-server-connection-timed-out">android httpclient hangs on second request to the server (connection timed out)</a> , but is won't help. Maybe is not a api fault, but Android as it is. This app is pointing the api really often, but for the most of request everything is alright. </p>
  
  <p>Still can't get rid off the 30-45 seconds of hangs up. </p>
  
  <p>Today I tested again the app and I noticed that error occur only on wi-fi connection on Samsung Tablet with 3.2. On Wildfire with 2.3.7 (wi-fi and 3g) everything seems to be alright. I'm not telling that problem doesn't occur on mobile, but while I was testing I have not noticed timeouts.</p>