title: How to scan IP and Mac address of all Device Connected to wifi in android accurately?
body: <p>Hi i am trying to find all devices connected to My WIFI Router from android and ,i need to device Mac address and local ip address of each device (Including iOT Devices) , 
  right now , i am trying to find from ARP cache table . but sometime in the scan some devices are missing , it is not so accurate .</p>
  
  <p><strong>My Code :</strong></p>
  
  <pre><code> List&lt;LocalDeviceInfo&gt; devicesInfos = new ArrayList&lt;&gt;();
  
  
          BufferedReader bufferedReader = null;
  
          try {
              bufferedReader = new BufferedReader(new FileReader("/proc/net/arp"));
  
              String line;
              while ((line = bufferedReader.readLine()) != null) {
                  String[] splitted = line.split(" +");
                  if (splitted != null &amp;&amp; splitted.length &gt;= 4) {
                      String ip = splitted[0];
                      String mac = splitted[3];
                      if (mac.matches("..:..:..:..:..:..")) {
                          LocalDeviceInfo thisNode = new LocalDeviceInfo(ip, mac);
                          devicesInfos.add(thisNode);
                      }
                  }
              }
  
          } catch (FileNotFoundException e) {
              e.printStackTrace();
          } catch (IOException e) {
              e.printStackTrace();
          } finally{
              try {
                  bufferedReader.close();
              } catch (IOException e) {
                  e.printStackTrace();
              }
          }
  
          // Print Description
          for (LocalDeviceInfo devicesInfo :devicesInfos)
          {
              System.out.print("✅");
              System.out.println("IP : "+devicesInfo.getIp());
              System.out.println("Mac : "+devicesInfo.getMacAddress());
          }
  </code></pre>
  
  <hr>
  
  <blockquote>
    <p>How can i scan all devices (IP address and Mac address) in
    android accurately .</p>
  </blockquote>
  
  <hr>