Android examples for android.net.wifi:Wifi Scan
get Wifi Scan Results
import java.util.List; import android.content.Context; import android.net.wifi.ScanResult; import android.net.wifi.WifiManager; public class Main { public static List<ScanResult> getScanResults(Context context) { WifiManager wifiManager = (WifiManager) context.getSystemService(Context.WIFI_SERVICE); List<ScanResult> list = null; boolean f = wifiManager.startScan(); if (!f) {//from w w w . java 2s .c o m getScanResults(context); } else { list = wifiManager.getScanResults(); } return list; } }