Android-我怎样才能知道用户有多少未读邮件?[英] Android - How can I find out how many unread email the user has?

本文是小编为大家收集整理的关于Android-我怎样才能知道用户有多少未读邮件?的处理/解决方法,可以参考本文帮助大家快速定位并解决问题,中文翻译不准确的可切换到English标签页查看源文。

问题描述

我正在编写一个程序,该程序应显示未读的SMS,MMS,电话和电子邮件的数量.很容易找到如何查询短信和电话(我在此页面上使用了搜索),但是我无法找到如何查找电子邮件.

无论如何是否可以找出用户在手机中收到多少封未读的电子邮件?

推荐答案

我是Gmail Unread Count的作者.请查看 gmail.java ,这就是我使用的.有几种方法可以做到.我直接从标签中读取未读的计数.您应该能够通过阅读来源来弄清楚如何使用它.

从电子邮件中获取未读取的计数是不可能的,因此您必须在那里进行投票.

其他推荐答案

不幸的是,这将很困难,因为您不知道用户用于电子邮件的应用程序,并且没有共享数据库或提供商.

我建议您列出最受欢迎的电子邮件应用程序,分开实现计数器并添加数字.

我猜想Google的GMail和EMail应用程序之一是最受欢迎的应用程序,并且我在EMail获得Exchange Support之前使用了氮气Touchdown.

.

其他推荐答案

根据Android开发人员列表上的线程,我通过搜索"未读电子邮件计数",gmail.java文件找到,您可以找到 gmail4j (通过Google代码搜索找到)提供了您需要的提供商.这就是Gmail-Unread-Count的作者.

对不起,我还没有足够的代表链接到线程和应用程序,所以我只是链接到代码.

本文地址:https://www.itbaoku.cn/post/102497.html

问题描述

I'm writing a program that should display the amount of unread sms, mms, phone calls and emails. It was quite easy to find how to query for sms and phone calls (I used the search on this page) but I have not been able to find out how to query for emails.

Is there anyway to find out how many unread emails the user got in their phone?

推荐答案

I'm the author of Gmail Unread Count. Check out Gmail.java, it's what I use. There are a couple of ways to do it. I read the unread count directly from the label. You should be able to figure out how to use it by reading the source.

Getting the unread count from Email is afaik not possible so you'll have to do polling there.

其他推荐答案

Unfortunately that is going to be difficult because you don't know which application(s) the user uses for eMail and there is no shared database or provider.

I suggest you make a list of the most popular eMail apps, implement the counter separately and add the numbers.

I'm guessing Google's GMail and EMail apps are amongst the most popular and I've used Nitroid's Touchdown before EMail had exchange support.

其他推荐答案

According to a thread on the android developer list which I found by searching for "unread email count" , the Gmail.java file which you can find in gmail4j (found through Google Code search) gives the provider you need. That's what the author of gmail-unread-count did.

Sorry, I don't yet have enough rep to link to the thread & the app, so I'm just linking to the code.