Using InetAddress, I'm always getting loopback address even if I am connected to network and the Ip obtained from dhcp is something like : 172.17.13.41. Why ?
I've something like this :
InetAddress address = InetAddress.getLocalHost();
String myIp = address.getHostAddress();
System.out.println(myIp); // I expect the output 172.17.13.41 not 127.0.1.1