I am using the following code to get the IP address of my android phone.
try {
for (Enumeration<NetworkInterface> en = NetworkInterface.getNetworkInterfaces(); en.hasMoreElements();) {
NetworkInterface intf = en.nextElement();
for (Enumeration<InetAddress> enumIpAddr = intf.getInetAddresses(); enumIpAddr.hasMoreElements();) {
InetAddress inetAddress = enumIpAddr.nextElement();
if (!inetAddress.isLoopbackAddress()) {
return inetAddress.getHostAddress().toString();
//return inetAddress;
}
}
}
} catch (SocketException ex) {
Log.e("SALMAN", ex.toString());
}
it returns fe80::94ae:97c:2680:c6cb%rmnet0
I then set up a server on port 8080.
How can I use this address to connect a client to it? I was expecting an IPv4 address... Can I connect to it via chrome or something to test the connection?