2017-02-28 11 views
-2

私がそれを修正するために何をすべきか Wifiのスキャン[email protected] を得ていますか?コードは無線LANスキャン[email protected]は

パブリッククラスWifiServiceサービスがBluetoothDeviceListener、WiFiDeviceListener {

パブリックWifiService(){ }

@Override

を実装延びて以下説明する
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"); 
} 
} 
+0

ようこそ!あなたの質問を編集して[質問している問題を再現する最小限のコード](http://stackoverflow.com/help/mcve)を投稿してください。それは明確化を求めることなく私たちを助けることができるより良いチャンスを与えます – koceeng

+0

私はビーコン技術に取り組んでいます。私はアンドロイドスタジオのプロジェクトを作って、ユーザーが自分のwifisを開くときに通知を送信します。私は私のプロジェクトをデバッグするときにWifi Scanを取得しています。[email protected] –

+0

いくつかのコードを提供できますか?私だけでなく他の人もあなたに答えることができ、あなたの質問にdownvoteを避けることができます – koceeng

答えて

0

の下私のアンドロイドコードであります

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

公共IBinder [OnBind]の(意図意図){

// TODO: Return the communication channel to the service. 

throw new UnsupportedOperationException("Not yet implemented"); 

}

@Override

公共ボイドonLeDeviceDiscovered(ArrayListのDEVICELIST){

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

}

@Override

ます。public void onWiFiDeviceDiscovered(ArrayListのDEVICELIST){

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

}

}スタックオーバーフローに

+0

これは今うまく動いています –

関連する問題