I've written an app for HTC desire and it gets the devices IP address and prints it to the screen. When I install this app to my tab 10.1 the IP address come out in letter and numbers in a strange format?
private String getIpAddress()
{
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(); }
}
}
}
catch(SocketException ex)
{
Log.e(TAG , ex.toString());
}
return null;
}
What is different on the tab 10.1?
( IP returned - fe80::be47:60ff:feff:21e2)
Needs to be an IP address as this is what I pass to the terminal on PC to connect to my app.