I am a newbie. I would like to develop some apps with SMS functionality. Later on with the purpose of sending commands to an Arduino.
But It seems I stumble into a critical problem.
The code is sourced from a book, a simple text SMS send example. It should work but it doesn't.
Installation of the app via bridge is fine.
When this app is running and if push the send button the apps STOPS and the debug window returns this:
Error occurred on line: 41 (Main)
java.lang.SecurityException: Neither user 10463 nor current process has android.permission.READ_PHONE_STATE.
I’ve tried to add some rules in the manifest file but unfortunately without any luck:
AddPermission(android.permission.SEND_SMS)
AddPermission(android.permission.READ_PHONE_STATE
The same problem remains. The app halts + same error in the debug window.
It seems I am still stuck in some way. Somebody...?
My phone has Android OS 8.0.0.
Code attached.
Sub SEND_Click
For Each permission As String In Array(rp.PERMISSION_READ_PHONE_STATE, rp.PERMISSION_SEND_SMS)
rp.CheckAndRequest(permission)
Wait For Activity_PermissionResult (permission As String, Result As Boolean)
If Result = False Then
ToastMessageShow("No permission", True)
Return
End If
Next
Dim msg As String
msg = Command.Text
MySms.Send2("07391846950", msg, True, True)
End Sub