Okay.So I understand that permissions are required by various functions but what I don't understand is where these are actually actioned
Recently I upgraded a Bluetooth program to SDK 33 and after its failure found suggestions from this forum that I had to add the following to the manifest file.
AddPermission(android.permission.ACCESS_FINE_LOCATION)
AddPermission(android.permission.BLUETOOTH_ADVERTISE)
AddPermission(android.permission.BLUETOOTH_CONNECT)
AddPermission(android.permission.BLUETOOTH_SCAN
This didnt work until I then added the following to my code
The permissions can also be listed from the IDE, This gives me the manifest list as well as these
Serial:
android.permission.BLUETOOTH
android.permission.BLUETOOTH_ADMIN
Bluetooth
android.permission.BLUETOOTH
android.permission.BLUETOOTH_ADMIN
android.permission. ACCESS_COARSE_LOCATION
So, A toddlers guide please. What does adding the permissions to the Manifest actually do? Why do I also have to add them into code?
Do the other permission listed come via the Serial and Bluetooth libraries?
Recently I upgraded a Bluetooth program to SDK 33 and after its failure found suggestions from this forum that I had to add the following to the manifest file.
AddPermission(android.permission.ACCESS_FINE_LOCATION)
AddPermission(android.permission.BLUETOOTH_ADVERTISE)
AddPermission(android.permission.BLUETOOTH_CONNECT)
AddPermission(android.permission.BLUETOOTH_SCAN
This didnt work until I then added the following to my code
B4X:
If phone.SdkVersion >= 31 Then
Permissions = Array("android.permission.BLUETOOTH_SCAN", "android.permission.BLUETOOTH_CONNECT", rp.PERMISSION_ACCESS_FINE_LOCATION,rp.PERMISSION_ACCESS_COARSE_LOCATION)
Else
Permissions = Array(rp.PERMISSION_ACCESS_FINE_LOCATION)
End If
For Each per As String In Permissions
rp.CheckAndRequest(per)
Wait For Activity_PermissionResult (Permission As String, Result As Boolean)
If Result = False Then
ToastMessageShow("No permission: " & Permission, True)
Return
End If
Next
The permissions can also be listed from the IDE, This gives me the manifest list as well as these
Serial:
android.permission.BLUETOOTH
android.permission.BLUETOOTH_ADMIN
Bluetooth
android.permission.BLUETOOTH
android.permission.BLUETOOTH_ADMIN
android.permission. ACCESS_COARSE_LOCATION
So, A toddlers guide please. What does adding the permissions to the Manifest actually do? Why do I also have to add them into code?
Do the other permission listed come via the Serial and Bluetooth libraries?