Is Exists in WifiManager - Android android.net.wifi

Android examples for android.net.wifi:Wifi State

Description

Is Exists in WifiManager

Demo Code

import java.util.List;

import android.net.wifi.WifiConfiguration;
import android.net.wifi.WifiManager;

public class Main {

  public static WifiConfiguration IsExists(String SSID, WifiManager wifiManager) {
    List<WifiConfiguration> existingConfigs = wifiManager.getConfiguredNetworks();
    for (WifiConfiguration existingConfig : existingConfigs) {
      String ssid = existingConfig.SSID;
      if (existingConfig.SSID.equals(SSID)) {
        return existingConfig;
      }//from www.ja  v a  2s  . c  o m
    }
    return null;
  }

}

Related Tutorials