Application HANGS UP if 3G connection is used (WiFi is OK)
<p>My application uses the following codes to connect to web site and download a web page for processing.</p>

<pre><code>HttpURLConnection c = (HttpURLConnection) url.openConnection();
c.setRequestMethod("GET");
c.setRequestProperty("User-Agent", "Mozilla/3.0 (compatible; MSIE 4.0; Windows NT)");
c.setRequestProperty("Accept-Language", "zh-hk");
c.setRequestProperty("Connection", "Keep-Alive");
c.setConnectTimeout(6000); // mTimeout is in seconds

intTries = 3;

do {
   c.connect();
   if (c.getResponseCode() == 200) {
      break;
   }
   else {
      intTries --;
   }       
} while (intTries &gt; 0);
</code></pre>

<p>The codes are run in main thread only. If WiFi is being used, it is nice and clean. If 3G connection is being used, sometimes, it cannot get connected OR application HANGS.</p>

<p>Is there any significant difference between handling WiFi and 3G ?</p>

<p>Thanks.</p>
