I tested this version on the same Galaxy Tab A8 Android 13 (targetSdkVersion="33"). I get the error "Error starting discovery process.", even though I agree to all permission requests.
I wanted to create a new topic "Bluetooth and BLE usage in SDK 33". In the morning I tested SDK 33 and work with different versions of android and realized that now using sdk 33, even for classic bluetooth (not BLE), geolocation is now needed. I don't know why this is happening, but now it is.
Maybe it makes sense to write some example of how to make it work correctly on most devices with Bluetooth and BLE in the current conditions and make this work convenient for the end user... To provide for all options that the user can click....
I see it this way. In the worst case scenario, we do not have more than one permission, bluetooth and geolocation are turned off. When you press the button, first I think a dialog should appear to enable the bluetooth module. If the user forbids the inclusion (on purpose or accidentally), then if possible, ask again (if not the restrictions of andoid itself). Then there is a whole set of permissions depending on the version of the phone sdk. To be honest, I'm already confused about what and when to request ... I want to somehow systematize it...
I used to have this:
For classic bluetooth you need:
1) Turn on bluetooth
If BleMan.State = BleMan.STATE_POWERED_OFF Then
BTadmin.Initialize("BTadmin")
If BTadmin.IsEnabled = False Then
If BTadmin.Enable = False Then
ToastMessageShow(Main.loc.Localize("Bluetooth enable error"), True)
Else
ToastMessageShow(Main.loc.Localize("Enabling Bluetooth..."), False)
End If
End If
End If
2) request "PERMISSION_ACCESS_COARSE_LOCATION" and that's it. If the user does not give this permission, display a message that it must be given in the settings for it to work. This worked for all my devices.
For BLE you need:
1) Also turn on bluetooth
2) Next I checked sdk 22 and requested to enable GPS (Phone1.SdkVersion>22 And GPS1.GPSEnabled = False). If the user does not turn on GPS, display a message that it must be given in the settings for it to work.
3) Further, if GPS is enabled, it was necessary to check RunPer.Check(RunPer.PERMISSION_ACCESS_FINE_LOCATION) = False. Next, I requested this permission, and also if the user does not give this permission, display a message that for work it is necessary to give it in the settings. This worked for all my devices.
But now, by changing the sdk version, everything has become much more complicated ...