ThanosFisherman / WifiUtils

Easily Connect to WiFi Networks
Apache License 2.0
731 stars 188 forks source link

Get current WiFi ssid #90

Closed demiantres closed 3 years ago

demiantres commented 3 years ago

Hi,

Is there a method for getting the currently connected SSID (without knowing the SSID beforehand)?

Thanks,

asantana48 commented 3 years ago

I don't think it's in the library but you could do

WifiManager wifiManager = (WifiManager) context.getApplicationContext().getSystemService(Context.WIFI_SERVICE) wifiManager.getConnectionInfo().getSSID()