Code example for WifiInfo

Methods: getHiddenSSID, getIpAddress, getLinkSpeed, getMacAddress, getNetworkId, getRssi, getSSID

0
		} 
	} 
	private void getWifiAddress() { 
		WifiManager wifi = (WifiManager) getSystemService(Context.WIFI_SERVICE);
		WifiInfo info = wifi.getConnectionInfo();
		textView.append("HiddenSSID=" + info.getHiddenSSID() + "/n");
		textView.append("IpAddress=" + formatIP4(info.getIpAddress()) + "/n");
		textView.append("LinkSpeed=" + info.getLinkSpeed() + "/n");
		textView.append("NetworkId=" + info.getNetworkId() + "/n");
		textView.append("Rssi=" + info.getRssi() + "/n");
		textView.append("SSID=" + info.getSSID() + "/n");
		textView.append("MacAddress=" + info.getMacAddress() + "/n");
	} 
	private void getNetworkInfo() { 
		// 此处输出可用网络类型 
		ConnectivityManager mag = (ConnectivityManager) getSystemService(Context.CONNECTIVITY_SERVICE);
		textView.append("/nActive:/n");
		NetworkInfo info = mag.getActiveNetworkInfo();
		if (info != null) {
			textView.append("ExtraInfo=" + info.getExtraInfo() + "/n");
			textView.append("SubtypeName=" + info.getSubtypeName() + "/n");