Code example for WifiInfo

Methods: getLinkSpeedgetRssigetSSID

0
	 **/ 
	public static void getConnectedNetWorkInformation(final WifiManager wifiManager) {
		WifiInfo mWifiInfo = wifiManager.getConnectionInfo();
		String message;
		if(mWifiInfo != null){
			String ssid = mWifiInfo.getSSID();
			int wifiSignalStrength = WifiManager.calculateSignalLevel(mWifiInfo.getRssi(), 4);
			int link_speed = mWifiInfo.getLinkSpeed();
			message = String.format("connected to %s with signal strength %s and link speed of %s", ssid, wifiSignalStrength, link_speed);
		} 
		else{ 
			message = "Not Conntected to Any Wifi Network";
		} 
	} 
 
  /** 
   * Encloses the incoming string inside double quotes, if it isn't already quoted. 
   * @param string the input string 
   * @return a quoted string, of the form "input".  If the input string is null, it returns null 
   * as well.