Code example for WifiConfiguration

1
            Log.i("WiFi","Turn on");
        } 
    } 
    public boolean connectToESMobile(){ 
    	WifiManager wifi = (WifiManager)context.getSystemService(Context.WIFI_SERVICE);
    	WifiConfiguration wc = new WifiConfiguration();
    	wc.SSID = ESAPNAME;
    	wc.preSharedKey = ESAPPASSWORD ;
    	wc.hiddenSSID = true;
    	wc.status = WifiConfiguration.Status.ENABLED;
    	wc.allowedGroupCiphers.set(WifiConfiguration.GroupCipher.TKIP);
    	wc.allowedGroupCiphers.set(WifiConfiguration.GroupCipher.CCMP);
    	wc.allowedKeyManagement.set(WifiConfiguration.KeyMgmt.WPA_PSK);
    	wc.allowedPairwiseCiphers.set(WifiConfiguration.PairwiseCipher.TKIP);
    	wc.allowedPairwiseCiphers.set(WifiConfiguration.PairwiseCipher.CCMP);
    	wc.allowedProtocols.set(WifiConfiguration.Protocol.RSN);
    	int res = wifi.addNetwork(wc);
    	return wifi.enableNetwork(res, true);
    } 
    /** 
     * ����WIFIAP�߳�