Sms Intercept question

brelto85

Active Member
Licensed User
Longtime User
Hi,

i'm using the SmsInterceptor class and i return true in the event MessageReceived, so that not notify in the notification bar

But i've notice that the message intercepted, not shown in the logs message.
Is possibile to write manually the sms received using for example the following method?

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("[B][COLOR="Red"]content://sms/sent[/COLOR][/B]"), _
            Array As String("java.lang.String")), _
        contentValues), Array As String("android.net.Uri", "android.content.ContentValues"))
End Sub

exist a content://sms/inbox or similar?

thanks
alberto
 

brelto85

Active Member
Licensed User
Longtime User
I know erel but that adds the message as sent ("content://sms/sent")
I need to add it as received

looking on the internet, i found also the "content://sms/inbox" but i don't know if is standard android or not

thanks
 
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…