自动发送彩信(没有用户交互)
请家伙!我想没有用户界面自动发送彩信作为使用该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);