get WiFi Information - Android android.net.wifi

Android examples for android.net.wifi:Wifi Property

Description

get WiFi Information

Demo Code

import android.content.Context;
import android.net.ConnectivityManager;
import android.net.NetworkInfo;
import android.net.wifi.ScanResult;
import android.net.wifi.WifiConfiguration;
import android.net.wifi.WifiInfo;
import android.net.wifi.WifiManager;
import java.util.List;

public class Main{

    public static WifiInfo getWiFiInfo(Context c) {
        WifiManager wifiManager = getWifiManger(c);
        return wifiManager.getConnectionInfo();
    }/*  w w  w.ja v a2  s. c o m*/
    private static WifiManager getWifiManger(Context c) {
        return (WifiManager) c.getSystemService(c.WIFI_SERVICE);
    }

}

Related Tutorials