Code example for WifiInfo

Methods: getIpAddress, getSupplicantState, toString

0
    if (robotId.getWifi() == null) { //Does not matter what wifi network, always valid.
      return true; 
    } 
    if (wifiManager.isWifiEnabled()) {
      if (wifiInfo != null) {
        Log.d("WiFiChecker", "WiFi Info: " + wifiInfo.toString() + " IP " + wifiInfo.getIpAddress());
        if (wifiInfo.getSSID() != null && wifiInfo.getIpAddress() != 0
            && wifiInfo.getSupplicantState() == SupplicantState.COMPLETED) {
          if (wifiInfo.getSSID().equals(robotId.getWifi())) {
            return true; 
          } 
        } 
      } 
    } 
    return false; 
  } 
  private class CheckerThread extends Thread {
    private RobotId robotId;
    private WifiManager wifiManager;
    public CheckerThread(RobotId robotId, WifiManager wifi) {
      this.robotId = robotId;