Reputation: 7395
Is it possible to automatically connect two devices without requiring the user to tap an "accept" button when creating an Android WiFi Direct P2P connection?
Upvotes: 4
Views: 7224
Reputation: 630
A bit late response but it might help someone searching for an answer.
Yes it is possible by creating Access Point as @hengsti said, but I would suggest to consider using Google Nearby Connections API instead (Nearby -> Connections API). It is much more reliable and easier to use.
Upvotes: 4
Reputation: 350
In the mean time this is possible, by calling creategroup()
, where you instantly become goup owner of the wifi-direct connection. This creates an Access point which an client can connect to. The client can fetch the SSID and Password with a WIFI_P2P_CONNECTION_CHANGED_ACTION
event, see this blog and code example.
Upvotes: 0
Reputation: 535
Once the two devices have been connected at least once, the confirmation is no longer necessary. Otherwise the other two answers cover it quite nicely, it is not possible to do so at the moment, and probably never will, at least according to this "bug" report, which was deemed obsolete by one of the Android project members (see post 46).
Upvotes: 0
Reputation: 933
It is possible, but your device must be rooted. See my answer to the closely related question: https://stackoverflow.com/a/18629705/1041475.
Much more complicated alternative is to build your own ROM with that patch already applied.
Upvotes: 0
Reputation: 221
Check this link https://groups.google.com/forum/#!topic/android-platform/hN5WfXRzXpI it might help. He has conducted a few experiments on the way of connection , it might help
Upvotes: 0