You can use WifiManager and WifiInfo for getting Wifi SSID
WifiManager wifiManager = (WifiManager) getSystemService(WIFI_SERVICE);
WifiInfo wifiInfo = wifiManager.getConnectionInfo();
Log.d("wifiInfo", wifiInfo.toString());
Log.d("SSID",wifiInfo.getSSID());
Also add Permission in your Manifest file.
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE">
</uses-permission>
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…