0

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 :

zied
  • 201
  • 3
  • 7
  • 17
  • it doesn't depends on whether you're using a wifi or 3G connection, If you're getting json on wifi you should also get it on 3G (both working normally) . also post your code. – Nitin Misra Feb 14 '14 at 09:16

2 Answers2

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