I thought that I should use NetworkInterface::getDisplayName. I got some name, but this name is different that this name which I can see, when I choosing to which network I want to connect.
I thought that I should use NetworkInterface::getDisplayName. I got some name, but this name is different that this name which I can see, when I choosing to which network I want to connect.
Simple as 2 lines
WifiManager w=(WifiManager)getSystemService(Context.WIFI_SERVICE);
String wifi=w.getConnectionInfo().getSSID();
Remember to put this in your Manifest
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE"/>