Android Question BLE Permissions ?

werner_Fourie

Member
Licensed User
Longtime User
Hi All
Im using this example https://www.b4x.com/android/forum/threads/ble-2-bluetooth-low-energy.59937/#content.
Android 7.0 and Android 8.0 devices
This example does not work if "android:targetSdkVersion="28"/>"
This is the permissions..
AddPermission(android.permission.ACCESS_COARSE_LOCATION)
AddPermission(android.permission.ACCESS_FINE_LOCATION) are set.

If I then enable location on the device this example starts to work..
Can anyone tell me if this is correct?

Why would You have to put locations on for BLE to work.

Thanks to all.
 

DonManfred

Expert
Licensed User
Longtime User
AddPermission(android.permission.ACCESS_COARSE_LOCATION)
AddPermission(android.permission.ACCESS_FINE_LOCATION) are set.
AND you ARE requesting the Permission at rumtime using RuntimePermissions library?

android.jar / targetSdkVersion / minSdkVersion

Especially RuntimePermissions

Note the comment in the Thread you lined:

Edit:

A new version of BLE_Example was uploaded. targetSdkVersion is now set to 26.
Setting the targetSdkVersion to 26 requires some changes:

1. Add the coarse location permission in the manifest editor.
2. Request this permission with RuntimePermissions.
 
Upvote 0
Top