Cell = "39348xxxxxx" ' phone number
Testo = "text to send"
FileUpload = "filename.ext" ' this file is already copied in Provider.SharedFolder
Dim in As Intent
in.Initialize(in.ACTION_SEND, "")
Starter.Provider.SetFileUriAsIntentData(in, FileUpload)
' get file extension
Dim FileExt As String = FileUpload.SubString2(FileUpload.LastIndexof("."), FileUpload.Length).ToLowerCase
Dim imageList As List
imageList.Initialize
imageList.AddAll(Array As String(".png",".jpg",".jpe",".jpeg",".gif",".bmp",".webp"))
If imageList.IndexOf(FileExt) >= 0 Then
in.SetType("image/*")
Else
in.SetType("application/*")
End If
in.SetPackage("com.whatsapp")
in.PutExtra("android.intent.extra.STREAM", Starter.Provider.GetFileUri(FileUpload))
in.PutExtra("android.intent.extra.TEXT", Testo)
in.PutExtra("jid", Cell & "@s.whatsapp.net")
StartActivity(in)