get Ssid from WifiManager - Android Wifi

Android examples for Wifi:Wifi Connection

Description

get Ssid from WifiManager

Demo Code


//package com.java2s;
import android.content.Context;

import android.net.wifi.WifiManager;

public class Main {
    public static String getSsid(Context context) {
        WifiManager wifiManager = (WifiManager) context
                .getSystemService(Context.WIFI_SERVICE);
        wifiManager.getConnectionInfo().getSSID();
        return wifiManager.getConnectionInfo().getSSID();
    }//  w w  w .j  av a  2  s  .c o  m
}

Related Tutorials