0

My app cannot connect to Webserver(using Xampp) via 3G but it works fine when connected by using WiFi(works on both real device(LG G2) and EMU).// PS. can connect to my webserver on web browser. When i using 3G, Log Cat shows "java.net.SocketException: recvfrom failed: ECONNRESET (Connection reset by peer)", cannot fetch the data fromw webserver. I'm very curious why it works fine when using WiFi, i'm have no idea why?. Thanks.

This topic has continued from this topic>>> HttpResponse response = client.execute(httpGet), the code after httpresponse doesn't run

Community
  • 1
  • 1
user3705368
  • 11
  • 1
  • 1
  • Where does your webserver reside? Is it reachable from internet? Where did the browser reside wich you used? You should test with a browser on your phone. – greenapps Jun 07 '14 at 07:53
  • is your webserver in your local LAN? – Milan Maharjan Jun 07 '14 at 07:57
  • @greenapps - my web server reside on my PC by using Xampp. And can access to url = "http://192.168.1.37/android_connection/showAllData.php"; by using web browser on both PC and my phone(when using WiFi) but cannot access by using web browser on my phone(when using 3G which on browser show "This web is not available") – user3705368 Jun 07 '14 at 08:03
  • I'm not using Local LAN for my webserver – user3705368 Jun 07 '14 at 08:04
  • 1
    Using 3G you are not on your LAN so you cannot use the local address 192.168.... You have to use the external/internet ip address of your router. Find out (on pc) with http://whatismyip.co. then configure the router to forward the used port (80 tcp/ip for http) to your local pc's ip address. – greenapps Jun 07 '14 at 08:10
  • Yes you are using local lan for your webserver. I can see it on 192.168... and that is what you said first. But you can make your webserver accessable from the internet by configuring the router as described. – greenapps Jun 07 '14 at 08:13

0 Answers0