Parth
Parth

Reputation: 1976

What is difference between beacon and normal ble detection in android?

when beacon is more useful in ble application in android? What are the benefits to use beacon ,is i know we can customize background scan rate. but using normal ble also we can change background scan rate by using SCAN_MODE_LOW_POWER and other flags. both will decrease the scan period. can anyone explain these

Upvotes: 2

Views: 3433

Answers (1)

davidgyoung
davidgyoung

Reputation: 64916

Beacons as a specialized version of a Bluetooth LE device. They are designed as transmit-only devices that simply send out a unique identifier at regular intervals, typically at 1-10 Hz. Beacons send out these identifiers using Bluetooth LE Advertisements, a feature which is a relatively small subset of the Bluetooth 4.0 specification.

Beacon-specific Android libraries like the Android Beacon Library are designed to focus on the use case of detecting Bluetooth LE beacons as opposed to doing more general purpose Bluetooth LE operations. A beacon library adds logic on top of built-in Android BLE Scanning including:

  • Parsing of beacon identifiers from raw BLE advertisements, based on different beacon formats (Eddystone, AltBeacon, iBeacon, etc.)
  • Event-driven APIs to tell you when a specific beacon identifier pattern is first seen and then stops being seen.
  • Regular callbacks (e.g. once per second) telling you a list of which beacons are visible.
  • Distance estimates to beacons.
  • Automatic switching of scan intervals as the app switches from the foreground to the background.
  • Automatic wakeup of the app when beacons are detected.

While it is possible to do all of the above with the lower-level Bluetooth LE APIs in Android, you have to write a lot of code to build these features yourself. Using a beacon library allows you to focus on your App's business logic and leave the complexities of dealing with the beacon parsing and detection functions to somebody else.

Full disclosure: I am the lead developer on the Android Beacon Library open source project.

Upvotes: 3

Related Questions