在android中发送没有用户交互的mms

时间:2012-05-31 12:32:49

标签: java android mms

 Intent intent = new Intent(Intent.ACTION_SENDTO);
 intent.putExtra("address", "12134567899");
 intent.putExtra("sms_body", "See attached picture");


 intent.putExtra(Intent.EXTRA_STREAM,
 Uri.parse("file:///sdcard/DCIM/Camera/2011-09-09 12.47.29.jpg"));
 intent.setType("image/png");


 intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);

 startActivity(intent);

我尝试这样的代码。如果意图启动mms compose ui即将到来我怎样才能克服并自动发送

3 个答案:

答案 0 :(得分:4)

首先。祝好运。 由于android sdk不支持MMS,因此您有2个选项:

  1. 下载android mms应用程序并试着了解那里发生了什么。

  2. 点击此链接: http://androidbridge.blogspot.com/2011/03/how-to-send-mms-programmatically-in.html

  3. 我发现此刻只有工作......

答案 1 :(得分:1)

此功能是Android中的安全功能,请不要试图绕过它。这是有原因的。

如果你绝对必须,你试过在root设备上运行吗?它允许更大的访问。

答案 2 :(得分:0)

试试这个与我一起工作。 使用  Uri.fromFile 代替  Uri.parse

File f=new File(Environment.getExternalStorageDirectory().getAbsolutePath()+"/DCIM/Camera/"+img_name);
Intent sendIntent = new Intent(Intent.ACTION_SEND); 
sendIntent.putExtra("", ""); 
sendIntent.putExtra(Intent.EXTRA_STREAM, Uri.fromFile(f));
sendIntent.setType("image/png");  
startActivity(sendIntent);