自动发送彩信(没有用户交互) [英] Send MMS automatically (without user interaction)

查看:308
本文介绍了自动发送彩信(没有用户交互)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

请家伙!我想没有用户界面自动发送彩信作为使用该code短信:

Please Guys ! I want to send MMS automatically without user interface as for SMS using this code :

 String messageToSend = "this is a message";
 String number = "2121234567";

 SmsManager.getDefault().sendTextMessage(number, null, messageToSend, null,null);

这code行之有效的短信,但我怎么能做到这一点彩信吗?

This code works well for SMS but how can i do it for MMS please ?

推荐答案

有没有公共API发送彩信无需用户交互的机器人。您可以在code的计算器如何通过彩信发送Android的形象?

There is no public API to send the MMS without user interaction in android. You can find the code on the stackoverflow How to send image via MMS in Android?

但是,这仍然不是好办法,因为它需要APN设置发送彩信。对于Android 4.0以上版本你不能在android系统的APN设置安全。因此,我向你推荐使用意图发送彩信。

But this still not the good way because it need the APN settings to send the MMS. For Android 4.0+ you can't get the APN Secure Settings in android. So I recommend to you to send the MMS using the Intent.

要使用意图发送彩信: -

To send the MMS using Intent :-

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.png"));
sendIntent.setType("image/png");
startActivity(sendIntent);

这篇关于自动发送彩信(没有用户交互)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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