如何以编程方式从Android设备读取RCS消息

Kri*_*ish 5 messaging sms android mms

我的应用程序基本上将短信和彩信备份到云服务器。我使用下面的 URI 从数据库中检索数据。

SMS- Uri uri = Uri.parse("content://sms/");


MMS-Uri uri = Uri.parse("content://mms/");

几天前在测试我的应用程序时,我注意到从 SQLite 检索时丢失了一些消息(短信和彩信)。在做了一些研究之后,我发现那些是 RCS(富通信服务)消息。现在我的挑战是阅读 RCS 消息(短信和彩信)。有没有办法在 Android 中读取 RCS(富通信服务)消息?我需要使用什么 URI 来读取 RCS(富通信服务)消息?

提前致谢。

Kev*_* Li 3

编辑:看来 API 毕竟不会\xe2\x80\x99t 成功。显然工作仍在进行中: https: //android-review.googlesource.com/q/RCS+(status:open+OR+status:merged). But it won\xe2\x80\x99t be for third-party developers.

\n\n
\n\n

根据这个(https://9to5google.com/2019/02/22/android-q-rcs-api-delay/), now there will be no developer-accessible API for RCS messages until Android R at the earliest.

\n\n
\n\n

目前没有 \xe2\x80\x99t 方法(缺少一些特定于供应商的 API),但如果代码提交表明 Android 的发展方向有任何指示,那么对以编程方式与 RCS 进行接口的支持正在进行中\xe2\x80\ xa6 https://android-review.googlesource.com/c/platform/frameworks/base/+/849669

\n\n

相关类仍在实现中,但看起来您\xe2\x80\x99将依赖这些(暂定):

\n\n
    \n
  • RcsParticipant
  • \n
  • RcsThread
  • \n
  • Rcs1To1Thread(延伸RcsThread
  • \n
  • RcsGroupThread(延伸RcsThread
  • \n
  • RcsMessage
  • \n
  • RcsIncomingMessage(延伸RcsMessage
  • \n
  • RcsOutgoingMessage(延伸RcsMessage
  • \n
  • RcsPart
  • \n
  • RcsFileTransferPart(延伸RcsPart
  • \n
  • RcsLocationPart(延伸RcsPart
  • \n
  • RcsMultiMediaPart(延伸RcsPart
  • \n
  • RcsTextPart(延伸RcsPart
  • \n
\n\n

这段代码告诉我们:

\n\n
class RcsThreadQueryHelper {\n    static final String ASCENDING = "ASCENDING";\n    static final String DESCENDING = "DESCENDING";\n    static final String THREAD_ID = "_id";\n    static final Uri THREADS_URI = Uri.parse("content://rcs/thread");\n    static final Uri PARTICIPANTS_URI = Uri.parse("content://rcs/participant");\n    static final String[] THREAD_PROJECTION = new String[]{THREAD_ID};\n    static String buildWhereClause(RcsThreadQueryParameters queryParameters) {\n        // TODO - implement\n        return null;\n    }\n}\n
Run Code Online (Sandbox Code Playgroud)\n