get Wifi SSID - Android android.net.wifi

Android examples for android.net.wifi:Wifi SSID

Description

get Wifi SSID

Demo Code

import android.content.Context;
import android.net.ConnectivityManager;
import android.net.NetworkInfo;
import android.net.wifi.WifiManager;

public class Main{

    public static String getWifiSSID(Context context) {
        WifiManager mWifiManager = (WifiManager) context
                .getSystemService(Context.WIFI_SERVICE);
        return mWifiManager.getConnectionInfo().getSSID();
    }//from   w  w  w.j  a v a2  s .c  o m

}

Related Tutorials