通过为ACTION_BATTERY_CHANGED注册广播接收器,究竟消耗了多少功率? [英] 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.
所以我的问题是:使用多少会消耗掉多少电能ACTION_BATTERY_CHANGED广播接收器?有人知道我们在说多少电池寿命吗?
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?
推荐答案
我认为您不会消耗很多电量。仅当电平变化百分之一时发送此广播,
I don't think you'll drain much power. This broadcast is sent only when level changes by one percent,
例如:85%-> 86%或76%-> 75%。
For example: 85% -> 86% or 76% -> 75%.
Android OS已跟踪电池电量(它必须跟踪电池电量,以便在电池电量太低(约3-5%)时关闭手机)。因此,就电池性能而言,仅订阅该广播就不会引起用户的注意。
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).
这篇关于通过为ACTION_BATTERY_CHANGED注册广播接收器,究竟消耗了多少功率?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!