How can i check my android device support wifi direct?

后端 未结 5 1380
甜味超标
甜味超标 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:43

    In addition to StoneLam's answer, which is probably the most robust, a quicker-and-dirtier method would be to go ahead and call WifiP2pManager.discoverPeers() as you would if WiFi Direct were supported. The latter takes an ActionListener with an onFailure() callback. The failure reason passed to onFailure(int reason) can be P2P_UNSUPPORTED, which would answer your question: the device doesn't support WiFi Direct.

    A call to onSuccess() would mean the device does support WiFi Direct. A call to onFailure() with other failure reasons would probably be inconclusive as to the device's capabilities.

提交回复
热议问题