title: Keep a Service running even when phone is asleep?
body: <p>I have a Service in my application which is designed to run every 10 minutes. It basically checks up on our servers to see if everything is running properly and notifies the user of any problems. I created this application for internal use at our company.</p>
  
  <p>My co-worker used the application over the long weekend and noticed that no checks were performed when the device went to sleep. I was under the impression that the Service was supposed to keep running in the background until I explicitly call <code>stopService()</code> in my code.</p>
  
  <p>So ultimately, my goal is to have the service running until the user hits the off button in the application or kills the process.</p>
  
  <p>I heard about something called <code>WakeLock</code> which is meant to keep the screen from turning off, which is not what I want. I then heard of another thing called a <em>partial WakeLock</em>, which keeps the CPU running even when the device is asleep. The latter sounds closer to what I need.</p>
  
  <p>How do I acquire this WakeLock and when should I release it and are there other ways around this?</p>