标签: android-mms

以编程方式发送彩信

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

在这里:无法使用 SmsManager 发送彩信

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

如果我转到此处的 Android 文档,在 Telephony 中有 SMSManager 类。在 API 级别 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 …
Run Code Online (Sandbox Code Playgroud)

android telephony mms smsmanager android-mms

5
推荐指数
0
解决办法
826
查看次数

在后台服务中发送彩信,不显示任何界面

下面的代码MMS使用照片、文本和数字来导航我的默认应用程序

Intent mmsIntent = new Intent(Intent.ACTION_SEND);
mmsIntent.putExtra("sms_body", "text");
mmsIntent.putExtra("address", "121");
mmsIntent.putExtra(Intent.EXTRA_STREAM, Uri.fromFile(new File(Environment.getExternalStorageDirectory(), "photo.jpeg")));
mmsIntent.setType("image/jpeg");
mmsIntent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
startActivity(mmsIntent);
Run Code Online (Sandbox Code Playgroud)

我需要的是在后台发送彩信而不显示任何类型的界面。我可以使用 SmsManager 发送短信

SmsManagaer smsManager = SmsManager.getDefault();
smsManager.sendTextMessage(num, null, "Help Me", null, null);
Run Code Online (Sandbox Code Playgroud)

我可以用它smsManager.sendMultimediaMessage()来发送彩信吗(我已经尝试过这个方法,但还没有成功)?如果没有那它有什么用?还有其他方式可以在后台发送彩信吗?

java android mms android-intent android-mms

5
推荐指数
1
解决办法
1657
查看次数

在android中查找并整理所有短信/彩信

首先,我发现这个答案特别有用.然而,它让我想知道如何找到这样的信息.

我似乎无法弄清楚如何迭代收件箱中的所有邮件.我目前使用的解决方案Uri.parse("content://mms-sms/conversations")是使用"_id"和"ct_t".然而,似乎我只能在手机中找到三个对话,尽管有30个ms(其中20个在保存对话线程中,其他对话分为两个其他对话).对这样的陈述有意义content://mms-sms/conversations.但是,其他提供商似乎只处理短信或彩信.有没有办法以这种方式迭代整个消息列表,我"content://mms-sms/conversations"用其他东西替换?

public boolean refresh() {
    final String[] proj = new String[]{"_id","ct_t"};
    cursor = cr.query(Uri.parse("content://mms-sms/conversations"),proj,null,null,null);
    if(!(cursor.moveToFirst())) {
        empty = true;
        cursor.close();
        return false;
    }
    return true;
}
Run Code Online (Sandbox Code Playgroud)

我用下一个函数迭代消息

    public boolean next() {

        if(empty) {
            cursor.close();
            return false;
        }
        msgCnt = msgCnt + 1;

        Msg msg;
        String msgData = cursor.getString(cursor.getColumnIndex("ct_t"));
        if("application/cnd.wap.multipart.related".equals(msgData)) {
            msg = ParseMMS(cursor.getString(cursor.getColumnIndex("_id")));
        } else {
            msg = ParseSMS(cursor.getString(cursor.getColumnIndex("_id")));
        }


        if(!(cursor.moveToNext())) {
            empty = true;
            cursor.close();
            return false;
        }

        return true; …
Run Code Online (Sandbox Code Playgroud)

android android-contentprovider android-mms

4
推荐指数
2
解决办法
4246
查看次数

如何从content:// mms中检索彩信的日期。

我确实从该链接获得了有关如何检索mms的文本和图像的信息:如何在Android中读取MMS数据?

但是我不确定如何检索发送的彩信的日期。

我知道我必须研究content:// mms而不是content:// mms / part。

这是检索mms文本的方法:

private String getMmsText(String id) {
        Uri partURI = Uri.parse("content://mms/part/" + id);
        InputStream is = null;
        StringBuilder sb = new StringBuilder();
        try {
            is = getContentResolver().openInputStream(partURI);
            if (is != null) {
                InputStreamReader isr = new InputStreamReader(is, "UTF-8");
                BufferedReader reader = new BufferedReader(isr);
                String temp = reader.readLine();
                while (temp != null) {
                    sb.append(temp);
                    temp = reader.readLine();
                }
            }
        } catch (IOException e) {
        } finally {
            if (is != null) {
                try …
Run Code Online (Sandbox Code Playgroud)

android date textview android-sqlite android-mms

1
推荐指数
1
解决办法
1991
查看次数