-1

My app is working fine in AVD but when i try to run my app in my mobile it is showing this error. It is not connecting to server. It is not accessing php file. I have given path for php file is "http://10.0.0.72/myapp/search.php". I'm using wamp server and kept my php file inside www folder.

Logcat Error

java.net.ConnectException: failed to connect to /10.0.0.72 (port 80): connect failed: ETIMEDOUT (Connection timed out) 06-13 13:19:20.229 13823-14092/com.myapp W/System.err: at libcore.io.IoBridge.connect(IoBridge.java:114) Caused by: libcore.io.ErrnoException: connect failed: ETIMEDOUT (Connection timed out)

Your Common Sense
  • 156,878
  • 40
  • 214
  • 345

1 Answers1

0

I assume that you run your wamp server in local PC. Connect both your phone and PC (which has the wamp server) to the same network and replace 10.0.0.72 with the private IP of the PC. Try the url in the phone browser, It should be accessible. Make sure you have given internet permission in the manifest file.

ram
  • 483
  • 1
  • 4
  • 11
  • Thanks for your answer.....Yes I'm running wamp server in my local PC, and both are connected to same wifi. 10.0.0.72 This is private IP of my PC. I've also given Internet permission in the manifest file but din't get success. – Premprakash Jun 13 '17 at 08:57
  • Are you able to access the file in browser? – ram Jun 13 '17 at 09:12
  • No, I'm not able to access the file in phone browser. It's showing "ERR_CONNECTION_TIMED_OUT". – Premprakash Jun 14 '17 at 07:21
  • Seems like connection issue. Try with the network created by your phone hotspot. Connect the PC to the hotspot and try with the new IP. – ram Jun 14 '17 at 07:43
  • I tried with different network and new IP but it's showing "ERR_ADDRESS_UNREACHABLE". still did't get success. – Premprakash Jun 15 '17 at 05:23
  • https://www.google.co.in/url?sa=t&source=web&rct=j&url=https://stackoverflow.com/questions/8219062/cannot-access-wamp-server-on-local-network&ved=0ahUKEwjpy_-lnr_UAhWJuI8KHfbPDEcQFgguMAQ&usg=AFQjCNHFk2wMKLJs9sJxHYVM0bHtQngniQ&sig2=g6a4C15EnJhTVlypMoGDBg Maybe the answers in the link would help. Actually that guy made it work by disabling his antivirus. – ram Jun 15 '17 at 06:42