Accessing the host machine via the Android emulator

If you want to access a service/server running on the host machine you need to use specially designated IP addresses, such as 10.0.2.2.

Note: The following table is taken from Network address space

Network AddressDescription
10.0.2.1Router/gateway address
10.0.2.2Alias to your host loopback (i.e. 127.0.0.1 on the host machine)
10.0.2.3First DNS server
10.0.2.4/10.0.2.5/10.0.2.6Optional, second, third and fourth DNS server (if any)
10.0.2.15The emulated device network/ethernet interface
127.0.0.1The emulated device loopback interface