Search code examples
androidmms

Sending an image from SDcard?


I want to use an image from SD card and forward it to another number programatically in android. Both image and phone number are predefined.So there is no need of UI.. Can anyone help?

Thanks!!


Solution

  • If you need to send an MMS then use this code snippet:

    Intent sendIntent = new Intent(Intent.ACTION_SEND); 
    sendIntent.putExtra("sms_body", "some text"); 
    sendIntent.putExtra(Intent.EXTRA_STREAM, Uri.parse(url));
    sendIntent.setType("image/png");
    

    here uri is path of your file. plus you can also define the number on which you want to send this mms.