QT QBluetoothDeviceDiscoveryAgent require turn on GPS Module
-
I dont need use BLE in my app, but without GPS on my android classic bluetooth device scan does not work.
How to be? Is this a bug or expected behavior?In log: * qt.bluetooth.android: Search not possible due to turned off Location service *
I use:
QT 5.15
Android 8.0
Android SDK 30 -
I found a solution to my problem. The topic can be closed.
-
@RSmirnov said in QT QBluetoothDeviceDiscoveryAgent require turn on GPS Module:
How to be? Is this a bug or expected behavior?
This is expected behaviour. Android requires GPS for BLE discovery. This is true not only for Qt app, but for all Android apps.
-
@RSmirnov its no bug, its a stipulation from the OS due to security
You can potentially derive the physical location of a device when using Bluetooth without the User being aware of that. For that reason you have to enable GPS/Location service to use Bluetooth, that way the user is aware of that
-
If I recall correctly, GPS is not needed for BT classic.
It turns out that to scan devices, I will force the user to turn on GPS every time and it will be ok?
You don't need to force anything. Get the Android permission and system will do it automatically for you.
-
I found a solution to my problem. The topic can be closed.