Search code examples
androidwifi-directwifip2p

How to auto-accept Wi-Fi Direct connection requests in Android


I have 2 Android devices using WiFi Direct. On one device I can get information about the other device using the WifiP2pManager class, and request a connection to the other device. However when I request a connection, the other device pops up a little window and asks the user if they want to accept the connection request.

Is it possible to auto-accept these connection requests? I.E to be able to connect to the other device without user confirmation?


Solution

  • Based on the comments, do you really need to connect to the devices if you just want to track and log the vehicles around you ?

    I don't know the scope of the project, but you could simply use the WifiP2pDeviceList that you get when you request the peers in the WifiP2pManager. You could get the list of the devices (~= vehicles) around you and could log this.

    Connection is useful if you want to send more detailed information I guess.