Search code examples
androidandroid-wifi

Wifi Scan Resultandroid.net.wifi.WifiManager@4249dfb0


When I debug my android studio project it is getting Wifi Scan Resultandroid.net.wifi.WifiManager@4249dfb0 what should I do to correct it? my android code is below

public class WifiService extends Service implements BluetoothDeviceListener,WiFiDeviceListener{

public WifiService() {
}

@Override
public IBinder onBind(Intent intent) {

    // TODO: Return the communication channel to the service.
    BLEManager bleManager= new BLEManager(this);
    bleManager.scanLeDevice(25,25);
    //bleManager.stopLeDeviceScan();
    WiFiManager wiFiManager= new WiFiManager(this);
    wiFiManager.scanWiFiDevice(25,25);
    //wiFiManager.stopWiFiScan();



    throw new UnsupportedOperationException("Not yet implemented");

}
@Override
public void onLeDeviceDiscovered(ArrayList<BluetoothDevice> deviceList) {
    System.out.println("bluetooth enable notifications");
}
@Override
public void onWiFiDeviceDiscovered(ArrayList<WirelessFiDevice> deviceList) {
    System.out.println("wifi enable notifications");
 }
}

Solution

  • code will be following

    public class WifiService extends Service implements BluetoothDeviceListener,WiFiDeviceListener{

    public WifiService() { }

    @Override

    public void onCreate() {

     BLEManager bleManager= new BLEManager(this);
    bleManager.scanLeDevice(25,25);
    //bleManager.stopLeDeviceScan();
    WiFiManager wiFiManager= new WiFiManager(this);
    wiFiManager.scanWiFiDevice(25,25);
    //wiFiManager.stopWiFiScan();
    

    }

    @Override

    public IBinder onBind(Intent intent) {

    // TODO: Return the communication channel to the service.
    
    throw new UnsupportedOperationException("Not yet implemented");
    

    }

    @Override

    public void onLeDeviceDiscovered(ArrayList deviceList) {

    System.out.println("bluetooth enable notifications");
    

    }

    @Override

    public void onWiFiDeviceDiscovered(ArrayList deviceList) {

    System.out.println("wifi enable notifications");
    

    }

    }