How to get the Android Emulator's IP address?

Rajapandian picture Rajapandian · Nov 12, 2009 · Viewed 123.2k times · Source

I want to get the currently running Android Emulator's IP address through code. How can it be achieved?

Answer

Matthias picture Matthias · Nov 12, 2009

Just to clarify: from within your app, you can simply refer to the emulator as 'localhost' or 127.0.0.1.

Web traffic is routed through your development machine, so the emulator's external IP is whatever IP has been assigned to that machine by your provider. The development machine can always be reached from your device at 10.0.2.2.

Since you were asking only about the emulator's IP, what is it you're trying to do?