Skip to content

Instantly share code, notes, and snippets.

@MrCrambo
Created June 16, 2020 15:54
Show Gist options
  • Save MrCrambo/d65dc36bef8189ac0898d8815502200c to your computer and use it in GitHub Desktop.
Save MrCrambo/d65dc36bef8189ac0898d8815502200c to your computer and use it in GitHub Desktop.
final WifiManager wifimanager = (WifiManager) getApplicationContext().getSystemService(WIFI_SERVICE);
wifimanager.registerScanResultsCallback(getMainExecutor(), new WifiManager.ScanResultsCallback() {
@Override
public void onScanResultsAvailable() {
List<ScanResult> results = wifimanager.getScanResults();
for (ScanResult result : results) {
System.out.println(result.BSSID);
}
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment