I've got a problem with Bluetooth admin.StartDiscovery failing. I can see that others have had the same problem and have fixed it by either adding Course location permission, or switching off and on. Neither are working for me yet.
This is very old code, running on all sorts of tablets without a problem. The Galaxy Tab S6 (top-end Android 10 device with Dex etc...) is the first to cause a problem.
My code is in a service which is running. I call it from Main. Not sure what to try next?
I get "Error starting discovery process." every time.
I've removed and re-allowed the Location permission.
I've switched off and on.
I've paired with the device using the tablet's Bluetooth setting.
I've checked that admin.IsEnabled = True
Any more ideas?
EDIT: I am using B4A 9.90 and I have downloaded the new Bluetooth Chat example (using B4XPages). Same problem: admin.StartDiscovery fails.
This is very old code, running on all sorts of tablets without a problem. The Galaxy Tab S6 (top-end Android 10 device with Dex etc...) is the first to cause a problem.
My code is in a service which is running. I call it from Main. Not sure what to try next?
Call from Main:
Sub btn_Discover_Click
Starter.rp.CheckAndRequest(Starter.rp.PERMISSION_ACCESS_COARSE_LOCATION)
Wait For Activity_PermissionResult (Permission As String, Result As Boolean)
If Result = False Then
ToastMessageShow("Permission Required for Bluetooth...", False)
Return
End If
CommandEngine.FoundDevices.Clear
CommandEngine.FoundOtherDevices.Clear
If CommandEngine.Admin.StartDiscovery = False Then
ToastMessageShow("Error starting discovery process.", True)
Else
ToastMessageShow("Scanning for Bluetooth Devices...", True)
End If
End Sub
I get "Error starting discovery process." every time.
I've removed and re-allowed the Location permission.
I've switched off and on.
I've paired with the device using the tablet's Bluetooth setting.
I've checked that admin.IsEnabled = True
Any more ideas?
EDIT: I am using B4A 9.90 and I have downloaded the new Bluetooth Chat example (using B4XPages). Same problem: admin.StartDiscovery fails.
Last edited: