1

I need to get the details of all wireless devices that are connected to my wifi network. I'm getting IP, MAC addresses, somehow Vendors of device as well.

How do I get the device type? (i.e laptop, mobile, AC, Refrigerator) And host names?

InetAddress inetAddress = null;
        for (int i = 0; i < 256; i++) {
            try {
                inetAddress = InetAddress.getByName("192.168.1." + i);
                if (inetAddress.isReachable(30)) {
                    ConnectedDevice device = new ConnectedDevice();
                    device.setDeviceIPAddress(subnet + i);
                    device.setDeviceMACAddress(Utils.getMacAddressFromArpCache(inetAddress.getHostName()));

                    Log.d("Device", inetAddress.getHostName() + ", " + inetAddress.getHostAddress() + ", " + inetAddress.getCanonicalHostName() + ", " + device.getDeviceMACAddress());
                }
            } catch (Exception e) {
                e.printStackTrace();
            }
        }

getHostName(), getHostAddress(), getCanonicalHostName() all 3 methods of inetAddress returning the ip address only. How do I get host names of connected devices on my network? What else should I do to get all the possible details of devices? Please guide me.

Santhosh
  • 4,956
  • 12
  • 62
  • 90
  • I also donot know about it good. But I read about NMAP. You can read about it. – mubeen Apr 12 '16 at 08:53
  • You can also search for ip fingerprinting – mubeen Apr 12 '16 at 08:54
  • Looks like you're searching for something similar to [DLNA](https://en.wikipedia.org/wiki/Digital_Living_Network_Alliance) – Shark Apr 12 '16 at 08:54
  • At the end of the answer of the question I think they found a way to solve your problem http://stackoverflow.com/questions/13198669/any-way-to-discover-android-devices-on-your-network. Sorry to be a pain in the neck with my answers. Hope you find a solution soon. – Miguel Benitez Apr 13 '16 at 11:14
  • And I think It's solved in the question too. – Miguel Benitez Apr 13 '16 at 11:16

0 Answers0