Location needs to be enabled for BLE Scanning on Android 6.0
See original GitHub issueJust going to report this here for others.
Apparently the solution is: I solved this by setting targetSdkVersion to 22 in gradle file. You must declare ACCESS_COARSE_LOCATION
in the manifest but, BLE scanning will work even if user denies this permission from App Settings.
However my targetSdkVersion was set to 24 so I cannot downgrade my app or Google Play Console will complain.
Another solution would be if this library:
Can use BluetoothAdapter.startDiscovery()
.It will scan for both Bluetooth Smart and classic Bluetooth devices, but location services do not need to be enabled.(You still need ACCESS_COARSE_LOCATION permissions on Android 6.)
Thoughts about changing this?
Issue Analytics
- State:
- Created 6 years ago
- Reactions:3
- Comments:10
Top Results From Across the Web
Why do I need to turn on location services to pair with a ...
To fix that: revoke location permission from the app and toggle bluetooth off and on to disconnect; install "NRF Connect" from Play Store,...
Read more >Location needs to be enabled for BLE Scanning on Android 6.0
You must declare ACCESS_COARSE_LOCATION in the manifest but, BLE scanning will work even if user denies this permission from App Settings.
Read more >Bluetooth permissions - Android Developers
ACCESS_FINE_LOCATION is necessary because, on Android 11 and lower, a Bluetooth scan could potentially be used to gather information about the location of...
Read more >Android – Location needs to be enabled for Bluetooth Low ...
After upgrading to Android version 6.0 Bluetooth Low Energy (BLE) scanning will only work if Location services are enabled on the device.
Read more >BluetoothLeScanner.startScan require Location Service ...
P3, Get BLE scan result using 'BluetoothLeScanner.startScan' must open Location Service in Android 6.0. “ https://issuetracker.google.com/37065090 ”.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Yes — it would be possible. There are two caveats though:
I really appreciate your support Dariusz, but my use case requires the minimum configuration, and I don’t need the location or any of its related features (like the rssi). My question was if I targeted and used the Sdk 22 would it be possible to use this library without enabling location? Thank you