Q:

Which kind of service should I implement for a continuous background task?

I've been checking google's documentation for some days but I'm not sure how should I do this.
The idea over my head, is to create a service which runs in background (forever) even if device restarts, etc. (like for example, WhatsApp). This service should go over the internet every 30 minutes just on Thursdays (for example).
However, I'm not sure if I've to create a classic Service, one with a BroadCastReceiver, etc.
I want some explanations about where to focus my search. Which kind of service should I use to perform a never ending task?

A:

No one wants an app that runs forever in the background. You want an app that is periodically launched (in background), does it thing, and sleeps again.
Also, in android nothing will ever run 'forever'. The lifetime is handled by Android OS, meaning if it wants resources it can kill your app.
So you could two things:

BroadcastReceiver + Service: the BR listens to the Android Booted Intent, then starts your Service which may run indefinitely (using startService).
AlarmManager + BroadcastReceiver (+ Service): create alarms at specified intervals your want your BR launched. The BR can then start the Service which does the heavy work. After the Service is done it should kill himself!

IntentService cannot be used, because it will kill himself when there are no more tasks
BroadcastReceived cannot be used alone, because it can only live for a couple of seconds (10sec)
tl;dr
Don't make a Service which runs forever. Create a Service does it's task and kill himself when done. Then launch this Service periodically.

