title: How does whatsapp instantly receive a message?
body: <p>I'm trying to make a communication between my App and the server side. The app needs to receive messages from the server because it's remotely controlled. It works as a Background Service.</p>
  <p>I'm currently getting the messages from the external MySQL by using HTTPPost, doing requisitions every 20 seconds, but it spends much battery.</p>
  <p>I tried doing a Socket connection to a server (build in java): device connects to the server every 20 seconds and close the conn when it just receive the data, but it also spends much battery.</p>
  <p>Is there a way of receiving these messages instantly as Whatsapp does?</p>