title: How can i create a protocol similar to gmail in android?
body: <p>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?</p>
  
  <p>Thinking about an answer i had 1 idea:</p>
  
  <blockquote>
    <p>Android is connected to a gmail server which does not send anything untill it has new mails</p>
  </blockquote>
  
  <p>This solution , which is the only one i can think about, is a little bit expensive, in term of battery consumption. </p>
  
  <p>Do you have further ideas ? </p>
  
  <p>If not do you know some opensource server that will accomplish my idea ?</p>
  
  <p>Bests, Andrea</p>