Hi,
i used this code to simulate a new sms arrived...
...and in manifest:
But is possible to insert also regular notification like a normal sms arrived?
Thanks a lot!
i used this code to simulate a new sms arrived...
B4X:
Sub AddMessageToLogs(body As String, address As String)
Dim r As Reflector
r.Target = r.CreateObject("android.content.ContentValues")
r.RunMethod3("put", "address", "java.lang.String", address, "java.lang.String")
r.RunMethod3("put", "body", "java.lang.String", body, "java.lang.String")
Dim ContentValues As Object = r.Target
r.Target = r.GetContext
r.Target = r.RunMethod("getContentResolver")
r.RunMethod4("insert", Array As Object( _
r.RunStaticMethod("android.net.Uri", "parse", Array As Object("content://sms/inbox"), _
Array As String("java.lang.String")), _
ContentValues), Array As String("android.net.Uri", "android.content.ContentValues"))
End Sub
...and in manifest:
B4X:
AddPermission("android.permission.WRITE_SMS")
AddPermission("android.permission.READ_SMS")
But is possible to insert also regular notification like a normal sms arrived?
Thanks a lot!