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?
Asked
Active
Viewed 4,530 times
2 Answers
2
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.

Harshid
- 5,701
- 4
- 37
- 50
0
Why does not ACTION_SEND suit you? What exact functionality do you need?
Intent sendIntent = new Intent(Intent.ACTION_SEND,
Uri.parse("mms://"));
sendIntent.setType("image/jpeg");
String url = "file://sdcard//tmpPhoto.jpg";
sendIntent.putExtra(Intent.EXTRA_STREAM, Uri.parse(url));
startActivity(Intent.createChooser(sendIntent, "MMS:"));
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

Vadim Kotov
- 8,084
- 8
- 48
- 62

Vivienne Fosh
- 1,751
- 17
- 24
-
Intent.ACTION_SEND is ok, but I'm planning to send MMS using my own program, it's a little weird to jump to another program and send a MMS, rather than using my message sending program – Zhe Lu Feb 17 '11 at 07:06
-
Ok then check the link that i gave you and the sources. There is an API how to work with it. First check if MMS isConfigured/enabled, then send it. The code is in src folder – Vivienne Fosh Feb 17 '11 at 09:05