androidgoogle-nearbygoogle-nearby-connections

Is there a lower bound for the connection time of Nearby Connections API?


I would like to know if there is a lower bound when it comes to connection time using Nearby Connections API.

Is it different based on the Strategy?

I've read here on stack overflow that on P2P_POINT_TO_POINT there is an internal protocol to check the available connection methods for both devices, and then they switch to this method. I have small payloads (so the Strategy is not a problem), and my issue now is understanding the time constraints of this API.


Solution

  • The strategy shouldn't significantly affect the time to connect. In all 3 cases, Bluetooth is the primary mechanism for advertising/scanning/connecting. It's only after both sides accept the connection that they try to upgrade to different WiFi technologies.

    Expect ~3sec lower bound for connecting and ~7sec upper bound. If the phone is in a bad state, the upper bound can unfortunately go much much higher (~1min) although you can disconnect at any time.