i am using the code of this link How to get IP address of the device from code? but getting ip address different than from my machine....how can i get the ip address of my m
import the package java.net;
and write the code,
try { InetAddress thisIp =InetAddress.getLocalHost(); System.out.println("IP:"+thisIp.getHostAddress()); } catch(Exception e) { e.printStackTrace(); }