Why is Android WiFi Direct and Network Discovery so unreliable?

588 Views Asked by At

I am investigating Android Wifi Direct and Network Discovery.

I have followed the Google Android examples and come to the same conclusion on both implementations.

They are completely and utterly Unreliable.

I have followed this training tutorial https://developer.android.com/training/connect-devices-wirelessly/wifi-direct.html

WiFi Direct issues.

My call to

 mManager.discoverPeers(mChannel, new WifiP2pManager.ActionListener() 

ALWAYS returns success

however my Broadcast receiver either doesn't receive

WifiP2pManager.WIFI_P2P_PEERS_CHANGED_ACTION

at all

or when it does receive WifiP2pManager.WIFI_P2P_PEERS_CHANGED_ACTION the peer list is alway empty (e.g size() = 0).

I have four Android devices available to be "discovered"

and very rarely some of them are discovered.

The link I have shared seems pretty basic and simple to follow. I have passed listeners to all possible method calls and have never seen I fail error log.

What is the secret to developing a reliable WiFiDirect Android application.

The code I have developed matches EXACTLY that documented in the above link.

What debugging tools can I use to identify what my issue(s) are/is?

0

There are 0 best solutions below