Reputation: 14370
I need to know the wifi accesspoint name which the device is using.. How to do it?
Upvotes: 3
Views: 2549
Reputation: 1
An SSID/BSSID is not an access point name.
On a large enterprise network it is possible to have and SSID used across multiple physical access points.
Upvotes: 0
Reputation: 3855
Use the WifiManager.
WifiManager wifiManager = (WifiManager) getSystemService(Context.WIFI_SERVICE);
if (wifiManager != null) {
WifiInfo info = wifiManager.getConnectionInfo();
if (info != null) {
String ssid = info.getSSID();
...
}
}
Then you need to add a permission to your manifest.
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
Upvotes: 7