ninjasense
ninjasense

Reputation: 13856

Do android broadcast receivers consume battery life?

I have two receivers that are listening for android.intent.action.BOOT_COMPLETED and android.intent.action.PACKAGE_REPLACED. I was wondering how much battery life they are causing my phone to consume since they cause my app to constantly run now.

Upvotes: 7

Views: 3143

Answers (1)

CommonsWare
CommonsWare

Reputation: 1006694

The broadcast receivers themselves will not directly consume much battery life. BOOT_COMPLETED happens once; PACKAGE_REPLACED happens only on an application upgrade. Those probably average one event per day.

Now, if those broadcast receivers do other stuff, such as starting services, that may have significant battery implications...but that is a problem with your services, not with the receivers themselves.

Upvotes: 13

Related Questions