get WiFi Link Intensity - Android Phone

Android examples for Phone:wifi

Description

get WiFi Link Intensity

Demo Code


//package com.java2s;
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 getWiFiLinkIntensity(Context context) {
        WifiManager wifi_service = (WifiManager) context
                .getSystemService(context.WIFI_SERVICE);
        WifiInfo wifiInfo = wifi_service.getConnectionInfo();
        wifiInfo.getRssi();// w w  w .  j  a  va2  s.  c o m
        return wifiInfo.getRssi();
    }
}

Related Tutorials