I want to require entering a PIN when connecting two Android devices to ensure they are talking to each other.
There is a sample project in the Android SDK 17 called "WiFiDirectDemo". It establishes a Wi-Fi Direct connection but it lacks the PIN authentication.
- I don't know how to specify WiFiP2pConfig.wps.setup in the class DeviceDetailFragment around line 71. Do I specify the action on the current device (I want to show a auto-generated four-digit PIN), i. e. config.wps.setup = WPSInfo.DISPLAY, or should I specify the action on the peer, i. e. config.wps.setup = WPSInfo.KEYPAD?
- How can I detect the connection request on the other peer? I guess there is something I can listen to, e. g. in the BroadcastReceiver, but I cannot find it.
I'm an experienced iOS developer but Android is very new to me, maybe the the answer is obvious to you. Thanks for your help.