Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Exactly how much power is drained by registering a broadcast receiver for ACTION_BATTERY_CHANGED?

I am planning to write an app whose sole purpose will be to monitor the battery level, and launch an intent the moment it drops below a certain level. My one concern is that this itself will be a battery drain, and no one will want to use it.

So my question is: Exactly how much power is drained by using the ACTION_BATTERY_CHANGED broadcast receiver? Does anyone know approximately how much battery life we're talking about?

like image 320
malfunction Avatar asked Oct 11 '22 20:10

malfunction


1 Answers

I don't think you'll drain much power. This broadcast is sent only when level changes by one percent,

For example: 85% -> 86% or 76% -> 75%.

Android OS already tracks battery level (it has to track it in order to shutdown phone when level becomes too low, ~3-5%). So just subscribing to this broadcast shouldn't even be noticeable to the user (in terms of battery performance).

like image 130
inazaruk Avatar answered Oct 21 '22 14:10

inazaruk