5

I looked at code here: How to send image via MMS in Android?

And here: Unable to send MMS using SmsManager

And I did some research from other places as well, but so far I'm quite confused about how to send MMS messages to people without using intents.

If I go to the Android documentation here, in Telephony there is the SMSManager class. In API Level 21, they added a function called "sendMultimediaMessage()" that sends an MMS message.

void sendMultimediaMessage (Context context, 
                Uri contentUri, 
                String locationUrl, 
                Bundle configOverrides, 
                PendingIntent sentIntent)

Parameters
context Context: application context
contentUri  Uri: the content Uri from which the message pdu will be read
locationUrl String: the optional location url where message should be sent to
configOverrides Bundle: the carrier-specific messaging configuration values to override for sending the message.
sentIntent  PendingIntent: if not NULL this PendingIntent is broadcast when the message is successfully sent, or failed"

I can't seem to find any real usage or examples of this code being used. In my application, I want to send a picture message to someone in the background--no application should open in this process (which is why I can't use an intent).

For sending an MMS, I have a few basic questions:

1) How can I take a simple phone number and convert it into an appropriate "address" that MMS can use?

2) How can I actually use this function if all I have is a file path to my image and a phone number to send it to?

I am very new to this, so if someone can provide a thorough explanation I would be very grateful.

Community
  • 1
  • 1
jortyjorts
  • 51
  • 3

0 Answers0