While connecting to a peer using WiFi Direct, user's permission is required. I know that connection can't be made without user never giving the permission. So I would like a way to ask the user for permission only once at the first start of the application.
Asked
Active
Viewed 1,482 times
0
-
Your question is answered [here](http://stackoverflow.com/questions/29796765/connect-to-android-devices-using-wifi-direct-without-prompt) with example code. – hengsti Oct 28 '16 at 08:16
1 Answers
0
Every time you initiate a connection through WiFi Direct, a dialog will pop up to accept the connection. This is called the connection establishment phase and it uses WPS. When the user accepts the dialog, an encryption key is setup for the WiFi P2P group and all communication will be encrypted with that key using WPA2.
There's no Android permission for this as the establishment needs to happen every time a new group is formed, with a new key. Hopefully Google will come up with a new way of doing this that doesn't require the dialog to be accepted. Maybe an insecure WiFi Direct connection and we do our own crypto? That should be interesting.

Adrian Chifor
- 66
- 1
- 3