Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to connect to localhost from VS Android Emulator

I am attempting to connect to the localhost of the machine from which I am booting a VS Android Emulator. I am able to successfully connect to the IIS Server when the Android version is Kitkat. However, I fail to connect when the VS Android Version is Lollipop or Marshmallow. The way I am connecting to the localhost is typing http://169.254.80.80 in the browser of the Emulator. As per http://developer.android.com/tools/devices/emulator.html#networkaddresses I should be able to connect to localhost using the IP address 10.0.2.2. However, this IP address doesn't seem to work for me.

like image 401
JayHawk Avatar asked Jan 13 '16 23:01

JayHawk


People also ask

What is localhost in Android Studio?

🎉 Each instance of the Android emulator runs behind a virtual router/firewall. You can find a list of IP addresses used in the network address space here. Among these IP addresses, you will find a special alias to your host computer's loopback interface (aka localhost).

What is the localhost IP address?

In [techie] talk " A localhost is a Internet Protocol loopback device which can be used by TCP/IP applications to talk to themselves." The default internal loop IP for the localhost is usually 127.0. 0.1 . This IP is different from the IP that identifies the computer on the network.


1 Answers

VS studio Emulator work very fine and fast

see the screen shot that how you can connect VS Emulator to localhoat

enter image description here

like image 112
Adiii Avatar answered Sep 27 '22 20:09

Adiii