title: Keeping services awake without draining battery
body: <p>I have an application that needs to continuously listen for incoming requests over wifi. A service that runs in the background does this job. However, this service falls asleep after a while when the screen turns off.</p>
  
  <p>The solution from what I have searched is to use AlarmManager to keep it awake. But it is said that this will drain the battery of the device.
  So, is there another way to do this?</p>
  
  <p>For eg, what do apps like Whatsapp and Skype do? They don't seem to kill too much battery but they have continuously running services right?</p>
  
  <p>Also, in case AlarmManager is the only way, it would be really kind if someone could share a tutorial or example for it.</p>