I send an MMS message with an audio file as follows:

Intent i3 = new Intent(Intent.ACTION_SEND); i3.setClassName("com.android.mms", "com.android.mms.ui.ComposeMessageActivity"); i3.putExtra("address", номер телефона); i3.putExtra("sms_body", текстовое сообщение); i3.putExtra(Intent.EXTRA_STREAM, Uri.fromFile(прикреплённый аудио файл)); i3.setType("audio/*"); startActivity(i3); 

Is there a way to send an MMS without using new Intent(Intent.ACTION_SEND) ? That is, you need to send it so that the sending activity is not displayed, and the MMS message is sent immediately when you click on my button in my application.

    1 answer 1

    You can do without MMS. For example, SMS-ki, they support binary data. Therefore, you can send an audio file as follows:

     SmsManager.getDefault().sendDataMessage(номер телефона, null, 6737, byte[] прикреплённого аудио файла, null, null); 

    Where indicated null in the arguments - these are additional parameters, such as a scanner, whether the message was sent correctly, the message was sent, and so on. Here is the article, though in English, but everything is written clearly, clearly and clearly.