Jump to content
Rollo62

Annoying problem with Bluetooth LE on newer Android devices, in connection with neverForLocation Flag

Recommended Posts

Hi there,

I had again alonger session, making me headaches with mobile development.

Android 12-14+ should currently be affected, I was able to prove this on various devices.
 

The problem:
With normal IoT applications, there is the option of using the ‘neverForLocation’ flag to bypass the annoying location query.
So far, so good, this works with the normal BLE modules.

However, there are products that appear as IoT with a normal, general serial interface ( Characteristiocs Write / Read / Notify ),
but in which obviously a beacon chip is installed internally, which outputs a beacon / iBeacon identifier.

The special beacon function is not used at all, but is only present in the ‘Manufacturer specific data’ of the chip.
The device can be addressed normally via the characteristics and it works as it should.

However, if the ‘neverForLocation’ flag is used in the manifest, these IoT devices are suddenly no longer listed in DeviceDiscovery.

This makes sense, of course, because a beacon is a location-based device.
It is noted here under the Bluetooth definitions:

Quote

Note: If you include neverForLocation in your android:usesPermissionFlags, some BLE beacons are filtered from the scan results.


 

The solution:
Doesn't seem to exist.
# Either remove the ‘neverForLocation’ flag, then it works, or

# Do not use a BLE module that is pre-programmed for Beacon/iBeacon.
 

You can identify the modules with e.g.
the nRF Connect app in the list as ‘Device XYZ (iBeacon)’, you can click on them and display further data with ‘more’: ‘Company: Apple, Inc. 0x04’ and ‘Type: Beacon: 0x02’.

The LightBlue app shows ‘Device XYZ’ in the list, if this is clicked, then further data is shown.
Among other things, the ‘Manufacturer specific data: ’Apple, Inc. (0x4c): 0x0215FDA5....’
 

This identifier 0x4C02 therefore seems to be decisive for the categorisation as an iBeacon.

 

Are there maybe any other possible solutions, to use iBeacon, but still get listed in a normal DeviceDiscovery?
If not, then at least I hope my description might others stepping into the same trap.


 

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×