title: How to find all WiFi networks that are not in range?
body: <p>I am writing an application to display the WiFi network types and status. How do I find all the "not in range" WiFi networks? Is it possible to get the list of all configured (previously seen) WiFi networks that are out of range?</p>
  
  <p>I used the below code to get the result</p>
  
  <pre><code>    WifiManager mWifiManager = (WifiManager) getSystemService(Context.WIFI_SERVICE);
      List&lt;WifiConfiguration&gt; configs = mWifiManager.getConfiguredNetworks();
      List&lt;ScanResult&gt; results = mWifiManager.getScanResults();
      if (configs != null) {
          for (WifiConfiguration config : configs) {
              for (ScanResult result : results) {
                  if (result.SSID  == null || result.SSID.length() == 0) {
                      continue;
                  }
  
                  else {
                      if (result.SSID.equals(MyString.removeDoubleQuotes(config.SSID))) {
                          int level = mWifiManager.CalculateSignalLevel(result.level, 4);
                          Log.d("MyApp", Config.SSID + "  " + level);
                      }
                  }
              }
          }
      }
  </code></pre>
  
  <p>But if configured network is high in number then it will take long time to execute. Is there any way to optimize this problem? By getting the scanned result of only the configured network.</p>