1

I am working on a wireless file sharing app. I implemented the wifi p2p library with the help of the guide on the android developers page. when i try to find peers on both the devices, the other device (tested on android 6.0 and 7.0) shows my device. But my device(Oneplus 5, Android 8.0) does not show the other device for some reason. Any help is appreciated.

Phantômaxx
  • 37,901
  • 21
  • 84
  • 115
Neeraj Athalye
  • 508
  • 5
  • 26

1 Answers1

0

i assume you dont see list of devices means you getting peers 0 in this method.

 @Override
    public void onPeersAvailable(WifiP2pDeviceList peerList) {
     peerList.getDeviceList();// ->0 
     }

i was stuck with this same and turns out Location has to be turned on in order to discover nearby devices through Wifi Direct

this answer should help you.

in simple words. just turn on wifi in your phone(obviously permission too). and start discovery of devices.

Jolson Da Costa
  • 1,095
  • 1
  • 12
  • 31