Skip to content Skip to sidebar Skip to footer

Get The Unread Mail Count Gmail In Android

I want to get an int with the number of unread emails in the accounts of the device. I have seen that there is a new way to do this using the 'Gmail Labels Public API' http://andro

Solution 1:

You can get a label and check the messagesUnread. The INBOX label is probably what you want:

Request

GET https://www.googleapis.com/gmail/v1/users/me/labels/INBOX?access_token={ACCESS_TOKEN}

Response

{"id":"INBOX","name":"INBOX","messageListVisibility":"hide","labelListVisibility":"labelShow","type":"system","messagesTotal":4527,"messagesUnread":4498,"threadsTotal":4168,"threadsUnread":4154}

Solution 2:

Please read carefully this document and also check this one

Post a Comment for "Get The Unread Mail Count Gmail In Android"