*******************************************************
public String getLocalIpAddress() {
try {
for (Enumeration
NetworkInterface intf = en.nextElement();
for (Enumeration
InetAddress inetAddress = enumIpAddr.nextElement();
if (!inetAddress.isLoopbackAddress()) {
return inetAddress.getHostAddress().toString();
}
}
}
} catch (SocketException ex) {
Log.e(LOG_TAG, ex.toString());
}
return null;
}
Excellent information on Android Development and thanks for sharing this information.
ReplyDelete