【问题标题】:how to retrieve group SMS for all the phones in android?如何在android中检索所有手机的群组短信?
【发布时间】:2026-02-21 23:05:03
【问题描述】:

我有一个关于群发短信的小问题。

我有 4 台设备,例如 Samsung S4 (5.0)、Galaxy Nexus(4.3)、LG Nexus(5.0)、HTC one(4.4)。我收到个人短信,但无法收到群组短信。所以我试图检查每部手机中的群组 SMS 列以找到替代解决方案,但我能够看到每部手机的不同列。您知道我们如何检索所有手机的群组短信吗?

这是我用来获取所有手机的列名和数据的代码。

Uri uriSMSURI = Uri.parse("content://sms/");
    String[] projection = { "*" };
    Cursor cur = getContentResolver().query(uriSMSURI, projection, null,
            null, "date");

    while (cur.moveToNext()) {
            for(int i=0;i<cur.getColumnCount();i++)
            {
                try
                {
                    Log.d(cur.getColumnName(i),cur.getString(cur.getColumnIndex(cur.getColumnName(i))));
                }
                catch(Exception e)
                {
                }
            }
    }

期待帮助。

提前谢谢..

【问题讨论】:

    标签: android sms


    【解决方案1】:

    没有“群组”短信之类的东西。消息应用程序必须自己添加该功能。您会注意到,当您在 Android 中收到群组消息时,它实际上是一条彩信。

    您想要获取有关群组消息的信息的方式是使用 android.provider.Telephony.MmsSms 提供程序中的 CONTENT_CONVERSATIONS_URI 而不是您现在使用的 android.provider.Telephony.Sms 提供程序。使用 android.provider.Telephony.MmsSms.CONTENT_CONVERSATIONS_URI 而不是“content://sms/”

    【讨论】: