I'am trying to get a json file from a server using thread. with wifi I hav e no problem but when I switch to 3G, with my samsung galaxy s3 with an android version 4.1.2 I have no problem but with a samsung galaxy s4 android version 4.2.2 connection takes long (without printing a problem of connection) when I use browser for the some link, I have no problem. My code is given below :
Asked
Active
Viewed 141 times
2 Answers
0
How are you retrieving the JSON? it could be timing out on your 3g connection. i would suggest checking if you can increase the time it takes for a connection to timeout.
If you're using a WebView this might help. https://stackoverflow.com/a/7772884/856406

Community
- 1
- 1

Christopher Lawless
- 1,057
- 2
- 12
- 19
0
Try using AsynTask... http://developer.android.com/reference/android/os/AsyncTask.html
If its taking long time show progressdialog in preexecute

Pramod
- 1,123
- 2
- 12
- 33