I want to get a specific router info out of a WIFI scan in processing. First I scan for the WIFI and save it into a list.
WifiManager wifiManager = (WifiManager)getActivity().getSystemService(Context.WIFI_SERVICE);
wifiManager.startScan();
List<ScanResult> wifiList = wifiManager.getScanResults();
then I check if any of the items equals to the router name I am searching for (" dlink").
for(int i = 0; i < wifiList.size();i++){
if( wifiList.get(i).SSID.toString() == "dlink"){
con[0] = "router1 found";
}
}
The output is just null. I know for a fact that the router is in there. I printed out the list, checked in which position of the wifiList the router is. Compared the SSID of that router from the list to the router name, but it didn't work. I printed out the router's name char by char and it was the same.