Is there a way to increase BLE advertisement frequency in Android?

1.1k Views Asked by At

I have an Android device broadcasting a BLE advertisement using the following commands of AltBeacon library:

ADVERTISE_MODE_LOW_LATENCY  approx 1 Hz
ADVERTISE_MODE_BALANCED     approx 3 Hz
ADVERTISE_MODE_LOW_POWER    approx 10 Hz

I would like to increase this frequency more than 10 times per second. Is there a way to increase advertising frequency in Android? Or it is unchangeable?

2

There are 2 best solutions below

0
On

You can reach it with stopping and starting advertisement with code like this:

while (true) {
    beaconTransmitter.stopAdvertising()
    beaconTransmitter.startAdvertising(beacon, object : AdvertiseCallback() }
0
On

The different options you have shown that work with the Android Beacon Library's BeaconTransmitter class are built-in to Android. Unfortunately there are no other higher frequencies of transmission offered by Android APIs.

However, on many newer devices you may start more than one advertiser at a time. If you have a device like this (Pixel, Nexus, Galaxy, Nokia) you can simply start more than one BeaconTransmitter instance at a time, each set to advertise 10Hz. If you start 10, you effectively get advertising at 100Hz.