Пример #1
0
 /**
  * 判断wifi是否存在
  *
  * @param SSID
  * @param wifiManager
  * @return
  */
 public static WifiConfiguration isExsits(String SSID, WifiManager wifiManager) {
   List<WifiConfiguration> existingConfigs = wifiManager.getConfiguredNetworks();
   for (WifiConfiguration existingConfig : existingConfigs) {
     if (existingConfig.SSID.equals("\"" + SSID + "\"")) {
       return existingConfig;
     }
   }
   return null;
 }
Пример #2
0
 private WifiConfiguration IsExsits(String SSID) {
   List<WifiConfiguration> existingConfigs = mWifiManager.getConfiguredNetworks();
   for (WifiConfiguration existingConfig : existingConfigs) {
     if (existingConfig.SSID.equals("\"" + SSID + "\"")) {
       return existingConfig;
     }
   }
   return null;
 }
 private static Integer findNetworkInExistingConfig(WifiManager wifiManager, String ssid) {
   List<WifiConfiguration> existingConfigs = wifiManager.getConfiguredNetworks();
   for (WifiConfiguration existingConfig : existingConfigs) {
     if (existingConfig.SSID.equals(ssid)) {
       return existingConfig.networkId;
     }
   }
   return null;
 }