Jon Douglas The rantings of a developer

WakefulIntentService Xamarin.Android


I’ve seen this problem quite a lot recently…How do I receive notifications when my device is not awake? Is there a way to give an Android device coffee or have it listen to that Avicii song?(

So you may ask: “What does WakefulIntentService do?”

WakefulIntentService keeps a device awake by using the mechanism of WakeLock. A WakeLock is better known as a way to keep the device awake indefinitely until the WakeLock is released somehow.

The good part about this code, is that it has been tested much further than a normal implementation of a WakeLock mechanism. (Original Implementation in Java)

Other Alternatives

You could additionally use the Android Support package’s WakefulBroadcastReceiver, which is a way to trigger work to be done by a broadcast. This however depends completely on the situation.


  • Greater flexibility as it’s not strictly tied to an IntentService.
  • Uses one WakeLock per request and therefore is more resilient for potential problems with a static WakeLock.


  • Can be prone to a leak as the developer must call CompleteWakefulIntent().
  • It is a time-limited WakeLock and therefore will release after one minute. Which limits the flexibility with no overrides.
  • If the process is terminated by anything which causes the service to restart, the restarted service will not be under a WakeLock.