安卓接收短信意图

安卓接收短信意图

本文介绍了安卓接收短信意图:获取消息标识或线程ID的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我注册一个广播监听器接收 android.provider.Telephony.SMS_DELIVER 意图的行动。

I have register a Broadcast listener to receive the android.provider.Telephony.SMS_DELIVER Intent action.

我似乎能够得到身体这个新的消息,并发送者的电话号码。

I seem to be able to get the body, and sender phone number of this new message.

不过我不能够获得消息ID或线程这个新的消息标识。我发现的唯一方法是搜索邮件和会话表匹配的内容。但是,这似乎有点乱,我觉得应该有一个更合适的方法。

However I am not able to get the Message Id or Thread Id of this new message. The only way I have found is to search the message and conversation tables for matching content. But this seems a little messy and I feel like there should be a neater way.

附注:
有没有办法,我已经错过了一些短的文件?因为很多短信API似乎非常无证。

Side note:
Is there some SMS documentation that I have missed? Because a lot of the SMS api seems very undocumented.

推荐答案

有没有消息ID或短信线程的ID。每个SMS是数据分组是完全独立于所有其他SMS。在Android中,有存储的短信在数据库中,线程使用未包含在SMS消息本身内的一些标准对话标准的短信应用。然而,第三方也可以建立管理在一个完全不同的方式短信SMS的应用程序。这在很大程度上取决于所管理短信的具体应用的理念和行动。这也是为什么没有关于SMS系统多​​文档。可用在Android的API是非常低的水平,非常基本的。其他应用程序建立在此之上。

There are no message IDs or thread IDs in SMS. Each SMS is a data packet that is completely independent of all other SMS. In Android, there is a standard SMS application that stores SMS in a database and "threads" conversations using some criteria which is not contained within the SMS message itself. However, third parties can also build SMS applications that manage the messages in a completely different way. This is very much dependent on the concept and implementation of the specific application that is managing the SMS. This is also why there isn't much documentation about the SMS system. The API that is available in Android is very low-level and very basic. Other applications build on top of this.

这篇关于安卓接收短信意图:获取消息标识或线程ID的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-04 04:02