Sahara Ali
Sahara Ali

Reputation: 21

Connection of Android Studio with localhost timed out

I have connected my Android App to WAMP server and I am running it on my mobile phone but each time I run the app, it gives the error:

Exception: failed to connect to /192.168.1.5 (port 9090): connect failed: ETIMEDOUT (Connection timed out)

I am giving this URL:

String url = "http://192.168.1.5:9090/phpmysql.php";

Can anyone tell me what am I doing wrong? I saw this link too but wasn't much helpful.

Upvotes: 1

Views: 1472

Answers (1)

Decoder
Decoder

Reputation: 1

Use 10.0.2.2 for emulator. I think the url you are using is creating problems.

If it doesn't fix this error, try resetting the adb connection by force closing it from task manager and restarting the emulator. Also the wamp server should be running and should be accessible from your local browser.

Upvotes: 0

Related Questions