get WiFi Link RSSI value - Android android.net.wifi

Android examples for android.net.wifi:Wifi Property

Description

get WiFi Link RSSI value

Demo Code

import android.annotation.SuppressLint;
import android.content.Context;
import android.net.wifi.WifiInfo;
import android.net.wifi.WifiManager;

public class Main{

    @SuppressLint("ServiceCast")
    public static long getWiFiLinkInensty(Context context) {
        WifiManager wifi_service = (WifiManager) context
                .getSystemService(context.WIFI_SERVICE);
        WifiInfo wifiInfo = wifi_service.getConnectionInfo();
        wifiInfo.getRssi();/*from   w w  w.  j a v a 2s . c o  m*/
        return wifiInfo.getRssi();
    }

}

Related Tutorials