I need more details than the 8 members of the current Sms library has.
In particular:
Status(Delivered, Read, Pending etc), Timestamp, sent time, delivered time and read time.
It seems it is possible to use reflection to access PDUS while intercepting SMS messages.
Can this be done with existing messages?
In particular:
Status(Delivered, Read, Pending etc), Timestamp, sent time, delivered time and read time.
It seems it is possible to use reflection to access PDUS while intercepting SMS messages.
B4X:
'Parses an SMS intent and returns an array of messages
Sub ParseSmsIntent (In As Intent) As Message()
Dim messages() As Message
If In.HasExtra("pdus") = False Then Return messages
Dim pdus() As Object
Dim r As Reflector
pdus = In.GetExtra("pdus")
If pdus.Length > 0 Then
Dim messages(pdus.Length) As Message
For i = 0 To pdus.Length - 1
r.Target = r.RunStaticMethod("android.telephony.SmsMessage", "createFromPdu", _
Array As Object(pdus(i)), Array As String("[B"))
messages(i).Body = r.RunMethod("getMessageBody")
messages(i).Address = r.RunMethod("getOriginatingAddress")
Next
End If
Return messages
End Sub
Can this be done with existing messages?