I've searched for couple days about sending MMS,all i can find is the intent.ACTION_SEND things.I'm building a messaging program and i really need this mms sending feature. Any tips about it? Is there any API for sending MMS?
How to send MMS using my code
4.5k Views Asked by Zhe Lu At
2
There are 2 best solutions below
0

If you have to send mms with any image then this code.
Intent sendIntent = new Intent(Intent.ACTION_SEND);
sendIntent.setClassName("com.android.mms", "com.android.mms.ui.ComposeMessageActivity");
sendIntent.putExtra("sms_body", "some text");
sendIntent.putExtra(Intent.EXTRA_STREAM, Uri.parse("file:///sdcard/image_4.png"));
sendIntent.setType("image/png");
startActivity(sendIntent);;
OR
If you have to send mms with audio or video file then used this.
Intent sendIntent = new Intent(Intent.ACTION_SEND);
sendIntent.setClassName("com.android.mms", "com.android.mms.ui.ComposeMessageActivity");
sendIntent.putExtra("address", "1213123123");
sendIntent.putExtra("sms_body", "if you are sending text");
final File file1 = new File(mFileName);
if(file1.exists()){
System.out.println("file is exist");
}
Uri uri = Uri.fromFile(file1);
sendIntent.putExtra(Intent.EXTRA_STREAM, uri);
sendIntent.setType("video/*");
startActivity(sendIntent);
any query please replay.
Why does not ACTION_SEND suit you? What exact functionality do you need?
Crude example, but even though as you see you may input any type of data there using MMS. You may also check this link, if you want more info: https://android.googlesource.com/platform/packages/apps/Mms