Android examples for Wifi:Wifi Connection
Check if Wifi has Password
//package com.java2s; import android.net.wifi.WifiConfiguration; import android.text.TextUtils; public class Main { public static boolean hasPassword(WifiConfiguration wifiConfig) { if (wifiConfig == null) { return true; }// w w w .java 2s. co m return !TextUtils.isEmpty(wifiConfig.preSharedKey) || !TextUtils.isEmpty(wifiConfig.wepKeys[0]) || !TextUtils.isEmpty(wifiConfig.wepKeys[1]) || !TextUtils.isEmpty(wifiConfig.wepKeys[2]) || !TextUtils.isEmpty(wifiConfig.wepKeys[3]); } }