Android examples for Wifi:Wifi SSID
get wifi SSID List Contains Key
import android.content.Context; import android.net.wifi.ScanResult; import android.net.wifi.WifiManager; import java.util.ArrayList; import java.util.List; public class Main{ //from w w w . j ava 2 s . c o m public static boolean getSSIDListContainsKey(final Context context, String targetSSID) { if (targetSSID == null) return false; List<ScanResult> apList = WifiUtils.getScanResults(context); if (apList == null) return false; for (ScanResult ap : apList) { if (ap.SSID.equals(targetSSID)) { return true; } } return false; } public static List<ScanResult> getScanResults(final Context context) { WifiManager manager = (WifiManager) context .getSystemService(Context.WIFI_SERVICE); if (manager.getWifiState() != WifiManager.WIFI_STATE_ENABLED) return null; // AP? context.enforceCallingOrSelfPermission( android.Manifest.permission.CHANGE_WIFI_STATE, "need permission: CHANGE_WIFI_STATE"); manager.startScan(); // return manager.getScanResults(); } }