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.
Asked
Active
Viewed 744 times
1

Phantômaxx
- 37,901
- 21
- 84
- 115

Neeraj Athalye
- 508
- 5
- 26
-
what error you get? – Hemant Parmar Jan 30 '18 at 10:00
-
@HemantParmar it doesnt give me any error, but the peers changed intent does not get triggered for my device. It did get triggered once or twice, but then it said that there are 0 devices nearby – Neeraj Athalye Jan 30 '18 at 10:07
1 Answers
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
-
The answer you have provided link is not working. Is there any other solution? – Priyanka Singhal May 24 '19 at 05:12