如何使用我的code发送彩信 [英] How to send MMS using my code

查看:165
本文介绍了如何使用我的code发送彩信的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我搜索过几天有关发送彩信,所有我能找到的是intent.ACTION_SEND things.I'm建立一个通讯程序,我真的需要这个彩信发送功能。关于它的任何提示?是否有发送彩信的API?

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?

推荐答案

如果你有发送彩信的任何图片那么这个code。

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);; 

如果你有发送彩信与音频或视频文件,然后用这个。

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.

这篇关于如何使用我的code发送彩信的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆