How can i check my android device support wifi direct?

后端 未结 5 1486
甜味超标
甜味超标 2021-02-03 16:19

I am working with android wifi direct demo application. After installation in my device I noticed that it is not working as expected.

I am confused, does my device supp

5条回答
  •  天命终不由人
    2021-02-03 16:31

    Android 4.0 and later support Wi-Fi Direct. However, some of 4.x devices does not support Wi-Fi Direct because of it's WiFi driver

    you can check your device using the code below

    mManager.discoverPeers(mChannel, new ActionListener() {
              @Override
              public void onSuccess() {
                    //onSuccess
              }
              @Override
              public void onFailure(int reason) {
                    //onFailure
              }
    });
    

    If your device support Wi-Fi Direct, onSuccess will be called after a moment. Otherwise, onFailure will be called.

提交回复
热议问题