Some issues with BLE Scanning

Hello Everybody! I have discovered that the BLE scan tools I am using from BluetoothLE1 (StartScanning, DeviceList, etc, etc) only work if the phone has its location function (GPS) activated.
My phone is Samsung M12 with Android v13
I didn't know this, probably most of you have known before.
Does someone know why it is neccesary this?
Thank You a lot.

Hello Alfredo - that is a requirement for Android, it's a Google Security Measure.

Thank you for your answer. But I still do not understand the concept behind this. Why is more secure to scan BLE devices with GPS activated?
Thank you again.!

6.0 marshmallow - Why do I need to turn on location services to pair with a Bluetooth device? - Android Enthusiasts Stack Exchange.

Unfortunately, Android does a fairly poor job of communicating what is going on here. The BLE extension never activates the location sensor (either GPS or network). Asking for the ACCESS_FINE_LOCATION permission does not guarantee that GPS will be used for anything, but I think many people believe that it does. Certain types of Bluetooth low energy beacons will broadcast their location in space, which therefore would allow the app to determine the user's fine location without needing to activate GPS. This is why the permission is needed to be asked for. Starting with Android 12, it is possible to assert in the manifest that an app does not use BLE for location sensing, in which case you don't need to request the permission and any BLE peripheral that uses a standard advertisement for location will not appear in the scan list.

Because all of this is handled in the Manifest, we must allow for these permissions to use the more permissive version that looks for location in the companion. The latest beta version of the BLE extension does include a property to set the flag related to turning off the location requirement, but this will only take effect for compiled apps.


This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.