Android Question Send mms

samperizal

Active Member
Licensed User
Longtime User
Greetings. I want to send mms and browsing the forum I found the following code.
Code:
Sub SendPhotoMessage(PhoneNumber As String, Message As String, Dir As String, Filename As String)
    Dim iIntent As Intent
    iIntent.Initialize("android.intent.action.SEND_MSG", "")
    iIntent.SetComponent("com.android.mms/.ui.ComposeMessageActivity")
    iIntent.setType("vnd.android-dir/mms-sms")
    iIntent.PutExtra("android.intent.extra.STREAM", CreateUri("file://" & File.Combine(Dir, Filename)))
    iIntent.PutExtra("sms_body", Message)
    iIntent.PutExtra("address", PhoneNumber)
    iIntent.SetType("image/png")
    StartActivity(iIntent)
End Sub

Sub CreateUri(uri As String) As Object
    Dim r As Reflector
    Return r.RunStaticMethod("android.net.Uri", "parse", Array As Object(uri), Array As String("java.lang.String"))
End Sub

When you open the messaging application, it does not pass the parameters.
Is it possible to automatically send the send?
Does anyone have an example of how to send mms with b4a?


Thank you.
 
Cookies are required to use this site. You must accept them to continue using the site. Learn more…