Android : MMS to specific number with image

on Thursday, April 2, 2015



String uriText = "mmsto:33" + //
"?body=" + Uri.encode("some subject text here33") + //
"&image=" + imageUri; //
Intent sendIntent = new Intent(android.content.Intent.ACTION_SENDTO, Uri.parse(uriText));
context.startActivity(sendIntent);


This code does not attach image to mms


I have tried content and file too but does not succeed.



Intent intent = new Intent(Intent.ACTION_SEND);
intent.setData(Uri.parse("smsto:")); // This ensures only SMS apps respond
intent.setType(HTTP.PLAIN_TEXT_TYPE);
intent.putExtra("sms_body", "ho");
intent.putExtra(Intent.EXTRA_STREAM, imagePath);
//if (intent.resolveActivity(context.getPackageManager()) != null) {
context.startActivity(intent);


This code does not add specific number to it, but it does attach image.


0 comments:

Post a Comment