title: Android Wi-Fi Scan: Filter printers from ScanResult
body: <p>I am working on a project, that needs to scan for public Wi-Fi access points. </p>
  
  <p>Currently, I am filtering the <code>ScanResult</code> like this:</p>
  
  <pre><code>for (ScanResult scanResult : wifiList) {
    if (!(scanResult.capabilities.contains("WEP") || 
          scanResult.capabilities.contains("WPA") || 
          scanResult.capabilities.contains("WPA2"))) {
  
                openWifiList.add(scanResult);    
  
    }
  }
  </code></pre>
  
  <p>It works fine, except that I also get printers that are nearby.</p>
  
  <p>While scanning, the phone is not connected to any network. </p>
  
  <p>I would have assumed that I get a list that is identically with the list of Wi-Fi connections that is shown in the Wi-Fi Settings on Android. But in the Wi-Fi Setting there is no printer shown ever.</p>
  
  <p>So for 1) I think it is strange that printers show up in the <code>ScanResult</code> list at all, <strong>should printers really be visible that way</strong>?</p>
  
  <hr>
  
  <p><strong><em>UPDATE:</em></strong> not all Wi-Fi printers are visible, I got some hints on that, and it seems like the printers that are showing up, do have a special functionality, e.g. HP printers support the <em>HP Wireless Direct</em> functionality (see e.g. <a href="https://h30434.www3.hp.com/t5/Inkjet-Printing/Printer-SSID-appearing-on-my-wi-fi-list/td-p/1705073" rel="noreferrer">https://h30434.www3.hp.com/t5/Inkjet-Printing/Printer-SSID-appearing-on-my-wi-fi-list/td-p/1705073</a> and <a href="https://support.hp.com/rs-en/document/c04577030" rel="noreferrer">https://support.hp.com/rs-en/document/c04577030</a>). </p>
  
  <hr>
  
  <p>And 2) <strong>is there any way that I could check whether the <code>ScanResult</code> belongs to a printer</strong>? </p>
  
  <p>So far I could only think of filtering for common SSID names, but that will not be very efficient or reliable.</p>
  
  <p>Thanks for any suggestions.</p>