以编程方式发送MMS消息

时间:2016-07-15 03:22:09

标签: android telephony mms smsmanager android-mms

我在这里查看了代码:How to send image via MMS in Android?

在这里:Unable to send MMS using SmsManager

我也从其他地方做了一些研究,但到目前为止,我对如何在不使用意图的情况下向人们发送MMS消息感到困惑。

如果我转到Android文档here,则在Telephony中有SMSManager类。在API Level 21中,他们添加了一个名为“sendMultimediaMessage()”的函数,用于发送MMS消息。

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"

我似乎无法找到使用此代码的任何实际用法或示例。在我的应用程序中,我想在后台向某人发送图片消息 - 在此过程中不应打开任何应用程序(这就是我无法使用意图的原因)。

对于发送彩信,我有一些基本问题:

1)如何使用简单的电话号码并将其转换为MMS可以使用的相应“地址”?

2)如果我拥有的是我的图像的文件路径和要发送给它的电话号码,我该如何实际使用此功能?

我对此非常陌生,所以如果有人能提供详尽的解释,我将非常感激。

0 个答案:

没有答案