短信的数量保持计数的Andr​​oid发送 [英] Keeping count of the number of SMS's sent in Android

查看:104
本文介绍了短信的数量保持计数的Andr​​oid发送的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我要跟踪的是从Android手机发送的消息数。我知道,有每次收到短信广播的消息,但没有特别的事件已发送消息。

I want to track the number of messages that are sent from an android phone. I'm aware that there is a Broadcast message whenever a SMS is received but there is no particular event for a sent message.

我不想最终计数出现在已发送区域COS邮件的数量,如果我删除已发送的邮件,计数会得到改变。

I don't wanna end up counting the number of messages that appear in the "sent" area cos if I delete a sent message, the count will get changed.

推荐答案

两个可能的解决方案:

  1. 您可以阅读的时间表已发送邮件文件夹,只能指望你上次检查的时间和你检查当前的时间之间已发送的时间戳的消息。

  1. You could read the sent messages folder on a schedule, and only count the messages with time stamps that were sent between the last time you checked and the current time you're checking.

您可以发送短信自己(假设用户是愿意去通过应用程序来做到这一点),然后通过您的待处理的意图,你可以很容易地告诉自己,当这样做。

You could send the sms yourself (assuming the user is willing to go through your application to do it), then through your pending intent you could easily tell yourself when this was done.

就个人而言,我想可能的解决方案#1,认为有一些短信应用程序甚至不存储短信的默认内容提供商的问题:内容://短信/发送,或者像你说的,用户可能会删除该邮件太快之前,它甚至可以算作是第一次。不幸的是,我不认为这是在这个时候一个更好的解决方案比两个解决方案,我提议的混合解决方案,甚至一个不保证你不会错过一些消息。

Personally, I like possible solution #1, thought there is the problem that some SMS applications don't even store the sms in the default content provider: content://sms/sent, or like you said, the user might delete the message too quickly before it can even be counted that first time. Unfortunately, I don't think there is a better solution at this time than an hybrid solution of the two solutions I'm proposing, and even that one offers no guarantee that you won't miss some messages.

这篇关于短信的数量保持计数的Andr​​oid发送的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆