Nearby Glasses tackles a tricky problem: detecting smart glasses nearby using Bluetooth Low Energy advertising frames. It does this by scanning BLE packets for manufacturer company IDs assigned by Bluetooth SIG and estimating proximity based on signal strength (RSSI). The approach is clever but inherently noisy, since these company IDs also correspond to other devices like VR headsets. Still, it’s a practical engineering compromise given the challenges of randomized MAC addresses and unstable UUIDs.
how Nearby Glasses detects smart glasses using BLE advertising frames
Nearby Glasses is an Android app written in Kotlin. It runs as a foreground service to keep scanning for BLE devices persistently without being killed by the OS. The app listens to BLE advertising frames emitted by nearby Bluetooth devices and filters them by manufacturer company IDs. These company IDs are unique numbers assigned by Bluetooth SIG to manufacturers. Nearby Glasses targets the IDs for Meta (0x01AB and 0x058E), Luxottica (0x0D53), and Snap (0x03C2), which correspond to popular smart glasses makers.
The app estimates proximity by measuring the Received Signal Strength Indicator (RSSI) of detected advertisements. RSSI is a rough proxy for distance but can be noisy due to environmental factors. Nearby Glasses uses a default RSSI threshold of -75 dBm (roughly 3 to 10 meters indoors) to decide if a device is “nearby.” This threshold is configurable by the user.
Under the hood, the app runs as an Android foreground service, which means it shows a persistent notification and is less likely to be killed by Android’s background process management. It also features notification cooldowns to avoid spamming, debug logging for troubleshooting, and user-configurable company ID filters.
Nearby Glasses does not collect telemetry or user data, respecting privacy.
the tradeoffs and technical strengths of using BLE manufacturer IDs and RSSI for proximity detection
The standout aspect of this repo is its pragmatic use of BLE advertising frames filtered by manufacturer company IDs to identify smart glasses nearby. This approach sidesteps the unreliable nature of randomized MAC addresses and unstable UUIDs, which are common roadblocks in Bluetooth device detection.
However, the tradeoff is clear: manufacturer company IDs are not unique to smart glasses alone. For example, Meta’s company IDs also cover Oculus Quest VR headsets. This causes false positives — the app may detect devices that are not actually glasses but share the same manufacturer ID space.
RSSI-based proximity estimation is also an imperfect science. Signal strength varies with environment, obstacles, and device orientation. The threshold of -75 dBm is a compromise that works well indoors but may miss devices further away or flag devices that are farther but have strong signals due to line-of-sight.
Still, the code is surprisingly clean and well organized. The app focuses on the core BLE scanning functionality without unnecessary dependencies. Using Android’s foreground service model is a sensible choice to maintain scanning persistence, especially on modern Android versions with aggressive background app restrictions.
This repo is worth understanding even if you don’t adopt it wholesale. It solves a real problem faced by BLE scanning apps: how to detect specific device classes despite Bluetooth’s privacy features designed to frustrate tracking.
quick start for Nearby Glasses
Requirements
- JDK 17 (required — project targets Java 17)
- Android SDK Platform 35 installed
- compileSdk = 35
- targetSdk = 35
- Git
This is what you need to build and run the app from source. The README does not provide explicit commands beyond these environment requirements, so follow standard Android build practices with Android Studio or Gradle.
Here is the README’s summary of RSSI thresholds for proximity estimation:
// RSSI proximity thresholds used in Nearby Glasses
val rssiDistances = mapOf(
-60 to "~1 – 3 m",
-70 to "~3 – 10 m",
-80 to "~10 – 20 m",
-90 to "~20 – 40 m",
-100 to "~30 – 100+ m or near signal loss"
)
// Default RSSI threshold for notifications
val defaultThreshold = -75
who should consider using Nearby Glasses
This app is relevant for developers and researchers interested in BLE device detection, especially in the context of smart glasses or wearables. It’s a solid example of how to work around Bluetooth’s privacy measures using manufacturer IDs and RSSI heuristics.
The tradeoffs mean it’s not suited for applications requiring high accuracy or strict device class discrimination. False positives due to overlapping company IDs and environmental noise in RSSI are unavoidable.
If you’re building an Android app that needs to detect certain classes of BLE devices persistently and with minimal dependencies, Nearby Glasses offers a practical starting point and architectural pattern. The code is straightforward, focused, and shows how to run continuous BLE scans in a foreground service — a useful pattern in Bluetooth Android development.
Overall, it’s a clean, honest implementation of a not-so-simple problem.
→ GitHub Repo: yjeanrenaud/yj_nearbyglasses ⭐ 1,730 · Kotlin