Code example for WifiManager

Methods: getWifiStatesetWifiEnabledstartScangetClass

0
		} 
	}	 
	//������ʵҲû���õ� 
	public int getWifiApState() { 
		try { 
			Method method = wifiManager.getClass().getMethod("getWifiApState");
			return (Integer) method.invoke(wifiManager);
		} catch (Exception e) {
			Log.e(TAG, "Cannot get WiFi AP state", e);
			return WIFI_AP_STATE_FAILED;
		} 
	} 
	//ͬ�� 
	public boolean isApEnabled() { 
        int state = getWifiApState();
        return WIFI_AP_STATE_ENABLING == state || WIFI_AP_STATE_ENABLED == state;
	} 
    //����GossipDog�ȵ�   
    public void connectAP() { 
    	int wifistate = getWifiApState();
    	if(wifistate != 1){
        	setWifiApEnabled(false); 
    	}  	 
    	if(wifiManager.getWifiState() == 1)
    		wifiManager.setWifiEnabled(true);
    	receiverWifi = new WifiReceiver();//��Ҫ�����������½�����receiverwifi���Ķ����ͼ���receiverwifiʱ���е�   	
		registerReceiver(receiverWifi, new IntentFilter(
				WifiManager.SCAN_RESULTS_AVAILABLE_ACTION));
		wifiManager.startScan();
		return ; 
    	 
    }    
    //û���õ� 
    private ArrayList<String> getConnectedIP() {
Stop searching for code, let great code find you!  Add Codota to your java IDE