Reputation: 12615
Is it possible to detect BSSID changes in the same network with the same SSID ? so when your mobile switchs to another access point, it fires a broadcast receiver.
Upvotes: 2
Views: 872
Reputation: 1335
yes, it is possible.
Create a BroadcastReceiver and register it to WifiManager action SUPPLICANT_STATE_CHANGED_ACTION.
In your onReceive, get the value of the WifiManager.EXTRA_NEW_STATE via intent.getParcelableExtra(). You can safely cast it to a SupplicantState object.
If the state is COMPLETED, you can get the BSSID from WifiInfo (WifiManager.getConnectionInfo).
Upvotes: 1