0

I have been trying to do a lot of trial and error to get this issue fixed but seems to have run out of more options.

Scenario: I have an AsyncTask that uses HttpClient to perform a simple HTTP POST transaction to a php page hosted on my server. This has been tested and it works perfectly fine when the connection type is Wifi.

Problem: As soon as I shift the data connection to EDGE, the data transfer does not work. I get the following error.

java.net.SocketException: The operation timed out

This usually happens on low-end devices. I have checked that the data connection is present and when I use the browser it works fine. The issue seems to be unrelated to my application as all other application apart from browser like Google Maps, Google Places are also not able to do any data transfer and are throwing host not found exception.

I have tried to increase the time out to see if this is because of slow connection but no relief.

HttpParams httpParameters = new BasicHttpParams();
HttpConnectionParams.setConnectionTimeout(httpParameters, 30000);
HttpConnectionParams.setSoTimeout(httpParameters, 30000);
HttpConnectionParams.setTcpNoDelay(httpParameters, true);

Permissions

<uses-permission android:name="android.permission.INTERNET"></uses-permission>
<uses-permission android:name="android.permission.VIBRATE"></uses-permission>
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION"></uses-permission>
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"></uses-permission>
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED"></uses-permission>
<uses-permission android:name="android.permission.READ_PHONE_STATE"></uses-permission>
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"></uses-permission>
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"></uses-permission>
Sufian
  • 6,405
  • 16
  • 66
  • 120
PravinCG
  • 7,688
  • 3
  • 30
  • 55

1 Answers1

4

Faced the same issue. Check the GPRS connection, it should work fine, When VodafoneLive! setting is used faced the above issue, selected VodafoneGPRS setting inside mobile networks, its working fine.

Echilon
  • 10,064
  • 33
  • 131
  • 217
glusus
  • 41
  • 2