Code example for WifiInfo

Methods: getRssi

0
 
	private void onRSSIEvent(Intent intent) {
		WifiManager myWifiManager = (WifiManager) context
				.getSystemService(Context.WIFI_SERVICE);
		WifiInfo myWifiInfo = myWifiManager.getConnectionInfo();
		Log.d(TAG, "Wifi RSSI: " + myWifiInfo.getRssi());
		if (rssiText != null) {
			rssiText.setText("Wifi RSSI: " + myWifiInfo.getRssi());
		} 
		writeRssiToLog(myWifiInfo.getRssi());
		 
		 
 
	} 
	 
	private void writeRssiToLog(int rssi) {
		try { 
			dlw.open();
		} catch (IOException e) {
			Log.e(TAG, "Error opening file, " + e.getMessage());