Android Question Bluetooth discovery problem on sdk 29

amidgeha

Active Member
Licensed User
Longtime User
Bluetooth discovery was working fine until I used sdk 29. Did I do something wrong?
 

klaus

Expert
Licensed User
Longtime User
You need to add the Permission_Access_FINE_LOCATION to your project.
Check the RuntimePermission library in the Libraries Manager Tab.
Add this line in the ManifestEditor:
AddPermission(android.permission.ACCESS_FINE_LOCATION)

And add this code at the beginning of the routine where you connect to Bluetooth.
B4X:
    Public rp As RuntimePermissions
    rp.CheckAndRequest(rp.PERMISSION_ACCESS_FINE_LOCATION)
    Wait For Activity_PermissionResult (Permission As String, Result As Boolean)

You might have a look at this thread: Android Bluetooth / BluetoothAdmin Tutorial
 
Upvote 0

amidgeha

Active Member
Licensed User
Longtime User
You need to add the Permission_Access_FINE_LOCATION to your project.
Check the RuntimePermission library in the Libraries Manager Tab.
Add this line in the ManifestEditor:
AddPermission(android.permission.ACCESS_FINE_LOCATION)

And add this code at the beginning of the routine where you connect to Bluetooth.
B4X:
    Public rp As RuntimePermissions
    rp.CheckAndRequest(rp.PERMISSION_ACCESS_FINE_LOCATION)
    Wait For Activity_PermissionResult (Permission As String, Result As Boolean)

You might have a look at this thread: Android Bluetooth / BluetoothAdmin Tutorial
Thanks a lot for this. It works on Android 9 and 10 with sdk 29
 
Upvote 0
Top