I use the code for this link How do I get the IP address of a device from code? but getting an ip address different from my machine .... how can I get the ip address of my machine on an Android emulator.
early
Check this out if you want to access the host machine.
Another solution is to run this on the shell
$ adb shell am start -a android.intent.action.WEB_SEARCH -e request "what is my ip"
will display your IP system
import java.net package;
and write the code,
try { InetAddress thisIp =InetAddress.getLocalHost(); System.out.println("IP:"+thisIp.getHostAddress()); } catch(Exception e) { e.printStackTrace(); }