[Q] Service vs. intents in the manifest file - efficiency

PeterSmithson

Member
Oct 10, 2011
14
1
0
Hi,

This is the first time I've started a thread so home I'm in the right place etc.

Just working on my first ever app. I created it as a service as that's what I thought I needed to monitor the battery status, screen status etc. I created some intent filters within the program itself to do that and assumed the process had to be running to get them.

Then I read I could have put the intents in the manifest file and my app will be started up if it isn't already running. That sounds quite neat as I can get rid of the notification icon I have to have in the notification area (I had to use setForeground to stop Android killing off the service and then immediately re-starting it). But -

Am I going to use up more battery with this second method? (using intents to wake the process) I'm not sure how often Android is going to terminate my process but if it's quite often then the overhead of my app starting up and reading some variables I'd have to persist could be a drain.

Any rule of thumb help here? I know the answer might have a bit of "depends" in it but really looking for some general advice.

Thanks.

Peter.