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
14
votes
4 answers

App crashes because of pendingIntent when targeting to Android 12

App crashed because of Nearby message API when targeting to android 12. Here is the crash log 2021-10-07 18:59:44.916 10343-10384/com.example.nearbymessagescanner E/AndroidRuntime: FATAL EXCEPTION: GoogleApiHandler Process:…
Garry
  • 193
  • 1
  • 5
10
votes
2 answers

Error codes in Nearby Connections 2.0

I've been experimenting with the new Android Nearby Connections v2.0 API. Most of my devices can now talk to each other most of the time, but I also get a lot of error codes back when trying to connect. Checking status.getStatusCode() inside my…
Rapunzel Van Winkle
  • 5,380
  • 6
  • 31
  • 48
9
votes
2 answers

Nearby connection API for Android - not working for some devices

I'm testing Nearby connection API with the sample application available here: https://github.com/googlesamples/android-nearby It seems that this is not working for some devices. I successfully connected Samsung Galaxy S3 with Nexus 7, in both…
Ramps
  • 5,190
  • 1
  • 45
  • 47
8
votes
1 answer

Google Nearby Connections 2.0 sometime ask for Bluetooth pairing PIN number

During testing of Google Nearby Connections 2.0 using the sample walkie-talkie program in automatic mode, sometimes the device will ask for Bluetooth pairing pin number. I have seen two scenarios: Only one device has a pop-up dialog asking for pin.…
user1416682
  • 991
  • 1
  • 7
  • 8
6
votes
0 answers

Not getting expected near by place from table

I have a place's table, in this, each record has latitude and longitude of that place. Now I want to find nearby places (within 10 KM) from places table according to given lat-long. I have 500 + place's records in my database table. Currently i am…
6
votes
2 answers

Nearby Messages using an IntentService

Initially I setup a BroadcastReceiver to receive intents from the Nearby Messages API. class BeaconMessageReceiver : BroadcastReceiver() { override fun onReceive(context: Context, intent: Intent) { …
Bryan
  • 14,756
  • 10
  • 70
  • 125
6
votes
1 answer

Nearby Connections 2.0: Both sides request connections, but don't successfully connect

I'm trying to use the new Android Nearby Connections v2.0 API with the P2P_CLUSTER connection strategy. The following problem (in which both devices request connections, but don't successfully connect) seems to occur on a variety of devices running…
Rapunzel Van Winkle
  • 5,380
  • 6
  • 31
  • 48
6
votes
0 answers

Android Nearby.MESSAGES_API to just detect beacons

I was earlier using the AltBeacon Library for detecting beacons and it works perfectly without any problems. Then i came across https://developers.google.com/beacons/overview?hl=en Which suggest The Google Proximity Beacon API can be used to…
Jayshil Dave
  • 1,106
  • 10
  • 22
6
votes
3 answers

Nearby API, what's the correct way of scanning for beacons in the background?

I'm looking at using Google's Nearby API to detect beacons (Eddystone). The only current approach at the moment seems to be calling Nearby.Messages.subscribe() as described here. The problem is that this doesn't seem to be suitable for continuous…
ivacf
  • 1,163
  • 3
  • 11
  • 15
6
votes
1 answer

Is it possible to publish messages using Google Nearby Messages in the background in iOS?

Is there any way to use Google Nearby Messages API to publish messages while the iOS application is in the background? According to the Nearby Messages API documentation: The publication is active as long as the publication object exists. To stop…
5
votes
0 answers

Google Nearby Messages Publish Returns 2806 Forbidden (Android - React Native)

We are currently utilizing a React Native wrapper over Google Nearby Messages (repo code here). On Android everything was working until about a week ago when suddenly everytime anything is published it returns a 2806 Forbidden error with almost no…
Perniferous
  • 513
  • 6
  • 19
5
votes
2 answers

How to get my own endpointId with Nearby Connections?

With Nearby Connections, each device has an endpointId, something similar to zkHk. Getting the endpointId of others is trivial since it is returned by the API when scanning or connecting to other devices. I must miss something, but I cannot find a…
Vincent Hiribarren
  • 5,254
  • 2
  • 41
  • 65
5
votes
2 answers

Google nearby between IOS and android

I recently heard about google nearby API, which supports both IOS and Android. I want to create a chat app. I want to know weather can I use this nearby api to create an app which chat between an android and IOS device (platform independent). Does…
VinoPravin
  • 947
  • 3
  • 17
  • 32
5
votes
1 answer

Location requirement to scan for BLE devices

BLE scanning faced a remarkable difference Marshmallow onwards with the requirement of location of device to be ON. Technically, I don't see a valid reason why location would be required to scan for BLE devices. Why has this been done by Google?
5
votes
1 answer

Is it possible to grant Nearby API permissions from phone settings?

Question Is it possible to grant Nearby API permissions from phone settings? If so, how? Does the answer vary by device API level? Read on for more context if needed :) General Background When an app targeting API level 23 or higher is installed…
stkent
  • 19,772
  • 14
  • 85
  • 111
1
2 3
27 28