Code example for WifiInfo

Methods: getBSSID, getHiddenSSID, getIpAddress, getLinkSpeed, getMacAddress, getNetworkId, getRssi, getSupplicantState

0
    OnClickListener updateButtonHandler = new OnClickListener() {
        public void onClick(View v) { 
            final WifiInfo wifiInfo = mWifiManager.getConnectionInfo(); 
 
            setWifiStateText(mWifiManager.getWifiState()); 
            mBSSID.setText(wifiInfo.getBSSID()); 
            mHiddenSSID.setText(String.valueOf(wifiInfo.getHiddenSSID())); 
            int ipAddr = wifiInfo.getIpAddress(); 
            StringBuffer ipBuf = new StringBuffer(); 
            ipBuf.append(ipAddr  & 0xff).append('.'). 
                append((ipAddr >>>= 8) & 0xff).append('.'). 
                append((ipAddr >>>= 8) & 0xff).append('.'). 
                append((ipAddr >>>= 8) & 0xff); 
 
            mIPAddr.setText(ipBuf); 
            mLinkSpeed.setText(String.valueOf(wifiInfo.getLinkSpeed())+" Mbps"); 
            mMACAddr.setText(wifiInfo.getMacAddress()); 
            mNetworkId.setText(String.valueOf(wifiInfo.getNetworkId())); 
            mRSSI.setText(String.valueOf(wifiInfo.getRssi())); 
            mSSID.setText(wifiInfo.getSSID()); 
 
            SupplicantState supplicantState = wifiInfo.getSupplicantState(); 
            setSupplicantStateText(supplicantState); 
        } 
    }; 
 
    private void setSupplicantStateText(SupplicantState supplicantState) {