Posted by Don
02 Nov 2008 at 12:08PM
Enumeration interfaces = java.net.NetworkInterface.getNetworkInterfaces();
for(;interfaces.hasMoreElements();){
NetworkInterface iface = interfaces.nextElement();
Log.i(appTag, "My interface is "+iface.getDisplayName());
Enumeration addrs = iface.getInetAddresses();
for(;addrs.hasMoreElements();) {
InetAddress addr = addrs.nextElement();
Log.i(appTag, " IP address is "+addr);
}
}
I/WhatIsMyIp( 4075): My interface is lo
I/WhatIsMyIp( 4075): IP address is /127.0.0.1
I/WhatIsMyIp( 4075): My interface is rmnet0
I/WhatIsMyIp( 4075): IP address is /25.128.65.151
Android phones are assigned a routable address!
$ nmap -PN 25.128.65.151
Starting Nmap 4.62 ( http://nmap.org ) at 2008-11-01 17:23 PDT
Interesting ports on 25.128.65.151:
Not shown: 1714 closed ports
PORT STATE SERVICE
225/tcp filtered unknown
Nmap done: 1 IP address (1 host up) scanned in 10.944 seconds
One port is open. I wonder if an android app can open a port to have inbound traffic initiated to the phone.
If so, a distributed hash table between running android phones could be built.