-3

How does gmail detect this when a mail arrives?
I guess, sending and receiving e-mail is not part of the Android operating system.
So, how does gmail do this?
Thanks in advance.

F. Ak
  • 9
  • 2
  • 1
    The official docs at [Gmail > API > Push Notifications](https://developers.google.com/gmail/api/guides/push) might help. – Gino Mempin Dec 03 '18 at 00:42

1 Answers1

0

This is a very broad question, but as a starting point I would suggest looking at the Google gmail API. There are some sample code snippets to demo functionality.

https://developers.google.com/apis-explorer/#p/gmail/v1/

specifically you may want to focus on setting up hooks via

gmail.users.watch Set up or update a push notification watch on the given user mailbox.

If you are looking more advanced such as how the Google servers send IPCs; then the Google Test scripts may be of use.

https://github.com/google/mail-importer/blob/master/src/test/java/to/lean/tools/gmail/importer/gmail/GmailSyncerTest.java