如何访问Android上的短信存储?

发布于 2024-10-14 14:32:25 字数 302 浏览 2 评论 0原文

初级 Android 开发人员请点击此处。

我正在尝试创建一个应用程序,该应用程序将读取设备上存储的短信,然后向用户提供有关其习惯的统计信息(例如他们经常向谁发送消息、常用单词等)。

但据我所知,似乎没有办法做到这一点。我环顾了论坛,人们谈论最多的是访问收件箱,您可以在其中找到用户尚未阅读的消息。那么默认应用程序和第三方(例如 Handcent)如何才能显示相同的文本呢?他们不保留自己的数据库,因为 Handcent 将在全新安装时显示所有文本。

tl;dr:如何在 Android 设备上阅读 SMS 消息,特别是之前已阅读过的消息。

Beginner Android dev here.

I'm trying to create an app that will read the SMS messages stored on the device and then give the user statistics about their habits (like who they message often, common words, etc).

But to my knowledge, there doesn't seem to be a way to do this. I've looked around on forums and the most anyone talks about is accessing the inbox where you can find messages the user hasn't read. How then can the default app and third-party (Handcent for example) display the same texts? They don't keep their own database because Handcent will display all texts upon fresh install.

tl;dr: How do I read SMS messages on an Android devices, specifically messages that have been read before.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

北方的巷 2024-10-21 14:32:25

有关访问 SMS/MMS 数据库的具体示例,请查看 gTalkSMS

For a concrete example of accessing the SMS/MMS database, take a look at gTalkSMS.

懵少女 2024-10-21 14:32:25

您将需要调用 SmsManager 类。您可能需要使用 STATUS_ON_ICC_READ 常量,并且可能将您获得的内容放入您的应用程序本地数据库中,以便您可以跟踪您已经阅读的内容与应用程序的新内容解析通过。
但请记住,您必须在清单中声明该类的使用,这样用户就会看到您可以访问他们在安装时获得的权限对话框中调用的短信。看到短信访问是不寻常的,可能会让一些用户望而却步。祝你好运。

这里是深入了解短信管理器的链接

You are going to need to call the SmsManager class. You are probably going to need to use the STATUS_ON_ICC_READ constant and maybe put what you get there into your apps local db so that you can keep track of what you have already read vs the new stuff for your app to parse through.
BUT bear in mind that you have to declare the use of the class in your manifest, so users will see that you have access to their SMS called out in the permissions dialogue they get when they install. Seeing SMS access is unusual and could put some users off. Good luck.

Here is the link that goes into depth on the Sms Manager

一人独醉 2024-10-21 14:32:25

执行以下操作,从此处下载 SQLLite 数据库浏览器:

找到您的数据库。文件在您的手机中。

然后,一旦您安装该程序,请转到:“浏览数据”,您将看到那里的所有短信!

您实际上可以将数据导出到 Excel 文件或 SQL。

Do the following, download SQLLite Database Browser from here:

Locate your db. file in your phone.

Then, as soon you install the program go to: "Browse Data", you will see all the SMS there!!

You can actually export the data to an excel file or SQL.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文