How to distinguish between different Wi-Fi networks?

If there are two Wi-Fi networks in the range that have the same SSID, security type and password, is there any identifier available to distinguish between? Is there any way to get this id in android?

+6
source share
3 answers

You can distinguish them through the BSSID - if someone does not assign a fixed MAC address, they will probably have different (unique) MAC addresses.

They can also be on another channel. I think it is impossible if two networks have the same SSID , the same channel and the same BSSID .

+6
source

You can try to extract the MAC address from the sending Router / AP networks. This address will be unique.

+1
source

use getSubtype () .

Mark slide 9 here :

 ConnectivityManager mConnectivity = null; TelephonyManager mTelephony = null; // Skip if no connection, or background data disabled NetworkInfo info = mConnectivity.getActiveNetworkInfo(); if (info == null || !mConnectivity.getBackgroundDataSetting()) { return false; } // Only update if WiFi or 3G is connected and not roaming int netType = info.getType(); int netSubtype = info.getSubtype(); if (netType == ConnectivityManager.TYPE_WIFI) { return info.isConnected(); } else if (netType == ConnectivityManager.TYPE_MOBILE && netSubtype == TelephonyManager.NETWORK_TYPE_UMTS && !mTelephony.isNetworkRoaming()) { return info.isConnected(); } else { return false; } 
+1
source

Source: https://habr.com/ru/post/952671/


All Articles