【问题标题】:Wifi Scan Resultandroid.net.wifi.WifiManager@4249dfb0Wifi扫描结果android.net.wifi.WifiManager@4249dfb0
【发布时间】:2017-02-28 04:39:46
【问题描述】:

当我调试我的 android studio 项目时,它得到了 Wifi扫描结果android.net.wifi.WifiManager@4249dfb0 我应该怎么做才能纠正它?我的安卓代码如下

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");
 }
}

【问题讨论】:

  • 欢迎来到 Stack Overflow!请编辑您的问题以发布minimal code that reproduces the problem that you're asking about。这将使我们有更好的机会在不要求澄清的情况下提供帮助
  • 我正在研究信标技术。我在 android studio 中制作了一个项目,当用户打开他们的 wifis 时会发送通知。当我调试我的项目时,我得到 Wifi Scan Resultandroid.net.wifi.WifiManager@4249dfb0
  • 你能提供一些代码吗?这样其他人,不仅是我,也可以回答你,避免对你的问题投反对票

标签: android android-wifi


【解决方案1】:

代码将跟随

公共类WifiService extends Service 实现BluetoothDeviceListener,WiFiDeviceListener{

公共 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");

}

}

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2013-04-13
    • 1970-01-01
    • 2018-08-17
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2014-07-26
    相关资源
    最近更新 更多