예제 #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
파일: WifiAdmin.java 프로젝트: theric/myAPP
 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;
 }