• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

How can i get SSID name?

Programmatic solution:

Code:
public static String getCurrentSsid(Context context) {
       String ssid = null;
       ConnectivityManager cm = (ConnectivityManager) context.getSystemService(Context.CONNECTIVITY_SERVICE);
       NetworkInfo networkInfo = cm.getActiveNetworkInfo();
       if (networkInfo == null) {
           return null;
       }

       if (networkInfo.isConnected()) {
           final WifiManager wifiManager = (WifiManager) context.getSystemService(Context.WIFI_SERVICE);
           final WifiInfo connectionInfo = wifiManager.getConnectionInfo();
           if (connectionInfo != null && !StringUtil.isBlank(connectionInfo.getSSID())) {
               ssid = connectionInfo.getSSID();
           }
       }

   return ssid;
}

with permissions:

Code:
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />

Thanks Stackoverflow
https://stackoverflow.com/questions/8811315/how-to-get-current-wifi-connection-info-in-android
 
Upvote 0

BEST TECH IN 2023

We've been tracking upcoming products and ranking the best tech since 2007. Thanks for trusting our opinion: we get rewarded through affiliate links that earn us a commission and we invite you to learn more about us.

Smartphones