HI,
after updating Ide to 12.2 the app that uses BlePeripheral release 1.01 on android 13 crashes.
The previous version compiled with Ide 11.8 and sdk 30 works fine.
In the code I have inserted the following function with which it appears to have the permissions
unfortunately it was communicated to me by a friend who uses the app, I don't have a cell with android 13
Thanks for your help
file Manifest
AddPermission(android.permission.ACCESS_FINE_LOCATION)
AddPermission(android.permission.BLUETOOTH_ADVERTISE)
AddPermission(android.permission.BLUETOOTH_CONNECT)
AddPermission(android.permission.BLUETOOTH_SCAN)
after updating Ide to 12.2 the app that uses BlePeripheral release 1.01 on android 13 crashes.
The previous version compiled with Ide 11.8 and sdk 30 works fine.
In the code I have inserted the following function with which it appears to have the permissions
unfortunately it was communicated to me by a friend who uses the app, I don't have a cell with android 13
Thanks for your help
B4X:
Sub GetPermission_Bluetooth As ResumableSub
Dim phone As Phone
If phone.SdkVersion >= 31 Then
For Each Permission As String In Array("android.permission.BLUETOOTH_SCAN", "android.permission.BLUETOOTH_CONNECT", "android.permission.BLUETOOTH_ADVERTISE")
Sleep(0)
Starter.rp.CheckAndRequest(Permission)
Wait For Activity_PermissionResult (Permission As String, Result As Boolean)
If Result = False Then
ToastMessageShow("No permission...", True )
Return False
Else
ToastMessageShow("OK permission...", True)
'LogColor("Permiso Bluetooth aprobado",Colors.Blue)
Return True
End If
Next
Else If phone.SdkVersion <> 31 Then
Log("Es diferente SdkVersion 31")
Return True
End If
End Sub
file Manifest
AddPermission(android.permission.ACCESS_FINE_LOCATION)
AddPermission(android.permission.BLUETOOTH_ADVERTISE)
AddPermission(android.permission.BLUETOOTH_CONNECT)
AddPermission(android.permission.BLUETOOTH_SCAN)
B4X:
Sub BleManager_StateChanged (State As Int)
Select State
Case BleManager.STATE_POWERED_OFF
CurrentStateTextBle = "POWERED OFF"
Case BleManager.STATE_POWERED_ON
CurrentStateTextBle = "POWERED ON"
Case BleManager.STATE_UNSUPPORTED
CurrentStateTextBle = "UNSUPPORTED"
End Select
If State <> BleManager.STATE_POWERED_ON Then
ToastMessageShow("Please enable Bluetooth", True)
NotAvailableBle = True
Else
BleReiPeripheral.Initialize("BleReiPeripheral", BleManager )
If BleReiPeripheral.IsPeripheralSupported = False Then
ToastMessageShow("Peripheral mode not supported.", True)
NotAvailableBle = True
Else
BleReiPeripheral.Start(GetBluetoothName)
Wait For BleReiPeripheral_Start (Success As Boolean)
Log("Peripheral started successfully? " & Success)
End If
End If
End Sub