Questions tagged [google-nearby]

Covers both Nearby APIs from Google. Messages is a publish-subscribe API for co-present iOS and Android devices to discover and communicate with each other, as well as beacons. Connections is a low-latency networking API for Android, powering use-cases such as: local multiplayer, collaborative whiteboards, and multi-screen gaming.

Nearby is divided into three parts:

  1. Nearby Messages is a cross-platform publish-subscribe API for exchanging <100KB messages between co-present devices that may or may not be on the same network. Nearby Messages is also used to detect beacons and retrieve messages associated with them via the Google Proximity API

  2. Nearby Connections is a low-latency, socket-like API for sending of bi-directional data between Android devices. Under the hood, the API uses a combination of Bluetooth, BLE, and Wifi hotspots, leveraging the strengths of each while circumventing their respective weaknesses.

  3. Nearby Notifications is for contextual device, app, and website discovery.

For more info developers.google.com/nearby

Nearby Messages

The Nearby Messages API is a publish-subscribe API that lets you pass small binary payloads between internet-connected Android and iOS devices. The devices don't have to be on the same network, but they do have to be connected to the Internet.

Nearby uses a combination of Bluetooth, Bluetooth Low Energy, Wi-Fi and an ultrasonic modem to communicate a unique-in-time pairing code between devices. The server facilitates message exchange between devices that detect the same pairing code.

Examples: Pocket Casts share podcast subscriptions, Trello share board

Nearby Connections

The Nearby Connections API enables your app to easily discover other devices on a local network, connect, and exchange messages in real-time. You can use the Nearby Connections API to give your apps the following capabilities:

  • Collaborative whiteboard: Jot ideas down with nearby participants on a shared virtual whiteboard.
  • Local multiplayer gaming: Set up a multiplayer game and invite other users on the local network to join it. Your app can also allow a player to start an in-game mission when enough nearby participants join.
  • Multi-screen gaming: Use a phone or tablet as a game controller to play games displayed on a nearby large-screen Android device, such as Android TV. Your app can also enable players to see a customized game screen on their personal devices while all nearby participants see a shared common view on a large-screen Android device.

Example: Beach Buggy Racing phone as controller

Nearby Notifications

Nearby Notifications enables you to advertise HTTPS URLs, trigger app intents, and trigger app installs using beacons.

419 questions
3
votes
1 answer

Nearby Connections NullPointerException

I've tried to use Nearby Connections, but I keep getting the dialog "Google Play Services" has crashed. The logcat shows a stack trace like this: 04-08 20:01:32.309 8904-11589/? E/AndroidRuntime: FATAL EXCEPTION: highpool[3] …
Chad Schultz
  • 7,770
  • 6
  • 57
  • 96
3
votes
1 answer

Subscribe to Nearby services - MessageListener never called

Subscribe to Nearby services always state that the subscribe is success but the MessageListener never called: MainActivity.java SubscribeOptions options = new SubscribeOptions.Builder() .setStrategy(Strategy.BLE_ONLY).build(); …
John
  • 31
  • 5
3
votes
3 answers

Android nearby without internet or local network

It's been a year Google released the Nearby API. I need to use it to let users communicate together when nearby. After checking this, I got frustrated: To use this user has to be connected to internet (nearby messages), otherwise user has to be on…
Achraf Amil
  • 1,275
  • 16
  • 20
3
votes
1 answer

Enabling Google Nearby Messages API offline?

I'm receiving messages triggered by Eddystone beacons using the Nearby Messages API in my iOS app and it works well. I'm using Firebase's realtime database for the app's backend. Since Firebase's caching is pretty awesome, I'm able to get the app…
James
  • 1,292
  • 1
  • 14
  • 29
3
votes
2 answers

Nearby API not getting any message

I have tried connecting to the Nearby Messages API, and have successfully been able to subscribe. Now, my mMessageListener field is never getting callbacks for some reason. I have already configured my beacons using the proximity beacon api using…
3
votes
1 answer

ConnectionResult{statusCode=INTERNAL_ERROR, resolution=null, message=null}

Implemented this sample on mobile & tablet everything is perfect ! But whit Android TV ADT-1 v5.0.2 build LRX22G these eloquent message shows up. GmsClient: unable to connect to service:…
Philippe David
  • 8,814
  • 3
  • 24
  • 35
3
votes
2 answers

Nearby Connections no ConnectionResponseCallback

I'm using Nearby Connections API in Android. It's working fine except cases where there is a sudden disconnections. The client again succeed in finding the endpoint, using the discovery process, yet when he uses sendConnectionRequest()…
danny11
  • 483
  • 1
  • 5
  • 12
3
votes
2 answers

Nearby Connection API - device not advertising after disconnecting few times

I'm using so called Nearby Connections. One device is advertising (Nearby.Connections.startAdvertising() ) and another is discovering (Nearby.Connections.startDiscovery() ). This api works fine, I can successfully connect to the host device.…
Ramps
  • 5,190
  • 1
  • 45
  • 47
2
votes
1 answer

Why are files transferred via bluetooth when using Android Nearby Share?

Nearby Share sometimes uses bluetooth to transfer the files because of which it is very slow. Sometimes it is not at all handy to transfer files that are more than 100 MB. Initially I thought Bluetooth is used only for handshaking purposes. But…
2
votes
1 answer

How to access file that has been transferred using Nearby Connections API with android 11, as file is stored in Nearby's scoped storage?

I am trying to transfer a file using googles Nearby Connections API. Largely I can get all components of the transfer to work so that all of the files data is transferred but the issue is that the files data is then stored in Nearby's scoped storage…
2
votes
1 answer

Android Nearby Connections cannot connect to device. Always returns 8011

I am trying to use Google Nearby Connections API to connect two Android devices to exchange data but no success. The devices can found eachother none of them can connect to the other. It always fails at onConnectionInitiated()…
sOnt
  • 87
  • 1
  • 5
  • 13
2
votes
0 answers

Google Nearby Connection: file exchange does not transfer whole file

I'm trying to implement file transfer using Nearby Connection with P2P_STAR strategy where the "spoke" sends a video file to the "hub". Using the documentation example I send the filenameMessage as bytes payload and the file payload. The receiver…
Razac
  • 21
  • 1
2
votes
1 answer

How to authenticate programatically Connection API?

I have to communicate with more than two devices which have been working perfectly with Google NearbyAPI Connections. Now I need to secure the connection restricting the access to the cluster network. The API exposes a method to authenticate the…
2
votes
1 answer

Flutter- Getting and error when asking for Nearbyplaces

Hi I want to implement Google Map and nearby Search in Flutter and I almost did it but I don't understand the error that I'm getting while trying to fetch the places near my position. I searched online but I couldn't figure it out, can anyone tell…
Alex97
  • 401
  • 1
  • 8
  • 21
2
votes
1 answer

Android NearBy API terribly slow (~10+ seconds for discovery and connection)

I'm trying to setup a communication channel between two Android phones. Unfortunately, Google decided to block developer access to Bluetooth adapter MAC address, effectively disabling the entire NFC to Bluetooth handover process (Simple Secure…
NOP-MOV
  • 792
  • 2
  • 8
  • 28