tags:

views:

130

answers:

2

I would like to explain me better. In android once you receive an email on gmail you would get notified almost in realtime. How does it work?

Thinking about an answer i had 1 idea:

Android is connected to a gmail server which does not send anything untill it has new mails

This solution , which is the only one i can think about, is a little bit expensive, in term of battery consumption.

Do you have further ideas ?

If not do you know some opensource server that will accomplish my idea ?

Bests, Andrea

+2  A: 

Read up on ActiveSync - that's how the Android does it to get push from Exchange and Gmail servers.

I believe it's a http stream with keepalive, with logic to determine the longest time between keepalive packets possible to reduce data traffic.

There are moves to use IMAP-IDLE for a push facility, and an article on that is Push-IMAP which may help you if you're developing something yourself.

Bobby
+1  A: 

Try XMPP, the Jabber protocol.

Javier