and getting this error
(IOException) java.io.IOException: read failed, socket might closed or timeout, read ret: -1
Thank you for answer. Your foult is not related to Android permissions. I am getting it always then Android cannot connect with Bluetooth module.
I have also took a simple app based on the example using HC05.
After making a correction in manifest have add a code:
'Bluetooth
If ph.SdkVersion >= 31 Then
For Each Permission As String In Array("android.permission.BLUETOOTH_SCAN", "android.permission.BLUETOOTH_CONNECT")
rp.CheckAndRequest(Permission)
Next
End If
before Bluetooth starting and in debug mode app is running.
Unfortunatelly after compiling in Release mode I am getting this foult in logs and phone screen:
java.lang.Exception: Sub activity_permissionresult was not found.
at anywheresoftware.b4a.BA.raiseEvent2(BA.java:227)
at anywheresoftware.b4a.BA$2.run(BA.java:395)
at android.os.Handler.handleCallback(Handler.java:958)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loopOnce(Looper.java:205)
at android.os.Looper.loop(Looper.java:294)
at android.app.ActivityThread.main(ActivityThread.java:8385)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:640)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:982)
java.lang.Exception: Sub activity_permissionresult was not found.
Strange thing (in my opinion) is that app is working after confirming this error on the screen.
Do you have an idea what is the reason of this foult ?