Robert,

You need to do *something* like that, enumerating the devices on the network.

How exactly, well, probably not with address.isReachable(), as that seems to be unreliable (search the group for more information).

The right way is going to depend on what exactly you are trying to discover.

For example, there is a UPnP discovery protocol for UPnP devices (Google for Java libraries that can do that).

You can also discover NetBIOS nodes, but in a different way from discovering UPnP devices.

Etc, etc, etc.

-- Kostya

16.04.2011 1:01, Robert ?????:
I've even tried this piece of code:

   byte[] ip = InetAddress.getLocalHost().getAddress();

   for (int i=1; i<=254; i++)
   {
      ip[3] = (byte)i;
      InetAddress address = InetAddress.getByAddress(ip);

      if (address.isReachable(1000))
         Log.d(LOG_TAG, "Name: " + address.getHostAddress());
   }

But all I get is the loopback address.
--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


--
Kostya Vasilyev -- http://kmansoft.wordpress.com

--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to