There is nothing to say about how to get the Wi-Fi SSID in different android versions. androidssid
There's nothing to say ......., why ......., is it fun ......., google's engineer who writes this interface to obtain wifiSSID is cool.
The method for obtaining wifiSSID is as follows:
Android.net. wifi. wifiManager mWifiManager = (WifiManager) MainActivity. this. getSystemService (Context. WIFI_SERVICE); android.net. wifi. wifiInfo mWifiInfo = mWifiManager. getConnectionInfo (); String currentWifiSsid = mWifiInfo. getSSID (); // get the current wifiSSID
I think everything is taken for granted. However, the currentWIfiSsid gets different values on different mobile phones along with one wifi! This leads to a series of unexpected events after the program.
My mobile phone system version is 4.1.1, And the SSID obtained by running is FAST_2C28; my colleague's mobile phone is 4.4 or 5.0, And the SSID obtained by running is "FAST_2C28", with quotation marks added .... I was impressed that there were not many quotation marks on 4.2 of the systems in the past. Why? What is the reason? The SSID obtained on their mobile phones has multiple quotation marks? I really have nothing to say.