Hi
I have problem for SMS message function.
If I receive the SMS message , how do I show the message to variable .
Because I need to confirm the message contents.
It's best to use a service which listens for new incoming messages. But everything depends on what you want to achieve.
Basically, you will have something like this:
B4X:
Sub sms_MessageReceived (From As String, Body As String) As Boolean
ToastMessageShow("adr:"&From&" content:"&Body,True)
If Body.IndexOf("SOME TEXT TO CHECK") <> -1 Then
m.Initialize
m.Address=From
m.Body=Body
Log(m)
'eat the event
ToastMessageShow("吃掉事件",True)
Return True
End If
'not eat the event
ToastMessageShow("不吃事件",True)
Return False
End Sub
Of course, you have to initialize the eventName as "sms".