Google has unveiled Nearby Connections 2.0, which provides offline, high-bandwidth peer-to-peer device communication.
Nearby Connections uses Wi-Fi, Bluetooth LE, and Classic Bluetooth to discover and establish connections to nearby devices.
It abstracts away the complexity of the radios by leveraging the strengths of each, while circumventing their respective weaknesses.
“This abstraction enables seamlessly upgrading the bandwidth of a connection by switching between the radios as and when it makes sense,” said Google.
It also means users can get over-the-air updates to use new radio technology as it becomes available, with no change in the application code.
At the heart of the Nearby Connections API is a connection – with Unix-socket-like semantics – that people can use to transfer bytes, files, or streams of data.
There are two supported connection types:
- Star – For creating 1:N topologies where there’s a centralised device that others are interested in. For example, the host of an offline game.
- Cluster – For creating M:N topologies that allow for looser mesh-like networks. For example, a classroom app that supports forming ad-hoc project groups for realtime collaboration.