Skip to content

Latest commit

 

History

History
38 lines (27 loc) · 1.42 KB

File metadata and controls

38 lines (27 loc) · 1.42 KB

Android Components > Libraries > Nearby

A component simplifying use of Google's Nearby Connections API, which provides "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. "

Main features:

  • Support for communication via wifi or Bluetooth directly between two Android devices.
  • Messages are securely encrypted (unless the client disables authentication, which is not recommended).

Usage

Setting up the dependency

Use Gradle to download the library from maven.mozilla.org (Setup repository):

implementation "org.mozilla.components:lib-nearby:{latest-version}"

Limitations

  • Communication is limited to a pair of devices.
  • Currently, messages are limited to 32 KB.
  • To make a connection, one device must call startAdvertising() and another must call startDiscovering().
  • This depends on Google Play services 11.0 or higher.

License

This Source Code Form is subject to the terms of the Mozilla Public
License, v. 2.0. If a copy of the MPL was not distributed with this
file, You can obtain one at http://mozilla.org/MPL/2.0/