【问题标题】:Android send sms with subjectAndroid 发送带有主题的短信
【发布时间】:2013-07-15 22:35:08
【问题描述】:

您好,我正在构建一个应用程序,我想通过它以编程方式发送短信,但我不知道如何像所有短信应用程序那样通过短信发送主题。

感谢您的帮助

【问题讨论】:

    标签: android sms subject


    【解决方案1】:

    SMS 没有主题行。我相信你必须做彩信才能有一个主题行。这是一个在 SO 上工作的example。如果您指的是某些第 3 部分 SMS 系统,它们通常将所有内容都放在原始字符串中,然后对其进行解析以向您展示他们想要的方式,但 SMS 中没有主题行。

    【讨论】:

    • 在 content://sms/ 中有一个名为主题的列?但我在 content://mms/ 中看不到该列
    • 我认为你是对的,虽然我觉得我上面写的很奇怪?
    • 我可能是错的,但您可以通过电子邮件发送短信,它可能只是作为电子邮件发送到短信的数据的占位符。
    • 当您添加主题行和/或图片时,它会自动变为 MMS,因为您对所有三个类别(SMS、MMS、EMAIL 到文本)都使用了 SmsMessage 类。
    【解决方案2】:

    似乎没有使用 Sms.SUBJECT 列,至少本机 SMS 应用程序没有使用。它可能是一个遗留列,旨在从 SMS 电子邮件网关填充,但 SmsMessageBase.extractEmailAddressFromMessageBody() 中的 cmets 明确表明不再支持此列:

     * Try to parse this message as an email gateway message
     * There are two ways specified in TS 23.040 Section 3.8 :
     *  - SMS message "may have its TP-PID set for Internet electronic mail - MT
     * SMS format: [<from-address><space>]<message> - "Depending on the
     * nature of the gateway, the destination/origination address is either
     * derived from the content of the SMS TP-OA or TP-DA field, or the
     * TP-OA/TP-DA field contains a generic gateway address and the to/from
     * address is added at the beginning as shown above." (which is supported here)
     * - Multiple addresses separated by commas, no spaces, Subject field delimited
     * by '()' or '##' and '#' Section 9.2.3.24.11 (which are NOT supported here)
    

    给定的应用程序可以选择填充列本身,但本机应用程序不会显示其内容,我敢打赌大多数其他应用程序也不会。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2014-08-07
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多