pradeep pradeep - 1 year ago 387
Android Question localhost/ - Connection refused

I am using xampp apache server to serve resources to the application from my machine. But i am getting the above error.

I got something on the google. pointing towards possible solution here

What is the solution for the above problem?

Answer Source

Since you have not specified your are connecting to server from device or emulator and I guess you are using your application in emulator.

If you are referring your localhost on your system from the Android emulator then you have to use Because Android emulator runs inside a Virtual Machine therefore here or localhost will be emulator's own loopback address.

Refer: Emulator Networking

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download