K.Muthu
K.Muthu

Reputation: 1252

send mms without user interaction in android

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

i try code like this. if intent start mms compose ui was coming how can i overcome and send automatically

Upvotes: 1

Views: 3376

Answers (3)

Hamza Alayed
Hamza Alayed

Reputation: 643

try this its worked with me . use Uri.fromFile instead of 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);

Upvotes: 0

Azulflame
Azulflame

Reputation: 1542

This feature was designed as a safety feature in Android, please do not try to bypass it. It's there for a reason.

If you absolutly must, have you tried running it on a rooted device? It allows greater access.

Upvotes: 1

zwebie
zwebie

Reputation: 2348

First of all. good luck. Since MMS isn't supported by the android sdk, you have 2 options:

  1. download the android mms aplication and try to understand what's going on there.

  2. follow this link: http://androidbridge.blogspot.com/2011/03/how-to-send-mms-programmatically-in.html

only thing I found working at the moment....

Upvotes: 4

Related Questions