Android Nearby Connections is a peer-to-peer networking API that allows apps to easily discover, connect to, and exchange data with nearby devices in real-time, regardless of network connectivity.
Android Nearby Connections API Changes in version 11.0.55
In GmsCore version 11.0.55, the Nearby Connections API was updated with a number of significant changes, including the following new features:
- Offline support. Nearby Connections now works fully offline, no network connectivity required. Devices no longer need to be connected to the same multicast-enabled wifi network to discover or connect to each other.
- Encrypted connections. Connections established between devices are now fully encrypted, ensuring that only the intended partipicants can read exchanged data.
- Large payload support. Nearby Connections now supports large Payload objects, which may be messages (up to 32kb), files, and even streaming data. The API also provides realtime progress updates about in-flight payloads.
- Simplified, symmetric API. The API has been simplified to be easy to use and more symmetric between advertiser and discoverer devices.
Learn more about the new functionality in the updated documentation.
Key differences
This section highlights some key differences between version 11.0.55 and previous versions of Nearby Connections.
- It is now possible to advertise and discover at the same time.
- You no longer need to check network connectivity or prompt users to connect to a multicast-enabled wifi network.
- It is no longer required to declare your
SERVICE_ID
in AndroidManifest.xml. Instead, pass it as a parameter to bothstartAdvertising()
andstartDiscovery()
. - There is now no distinction between “reliable” and “unreliable” send methods, as
sendReliableMessage()
andsendUnreliableMessage()
are now deprecated. All payloads are sent viasendPayload()
and are guaranteed to be delivered in order. - The device ID of discovered endpoints is no longer exposed.
Source viva: https://developers.google.com/nearby/connections/v11-update