coderslay
coderslay

Reputation: 14370

Need to know the wifi access Point name in android

I need to know the wifi accesspoint name which the device is using.. How to do it?

Upvotes: 3

Views: 2549

Answers (2)

JustAGuy
JustAGuy

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

rochdev
rochdev

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

Related Questions