Android: When is WakeLock needed? -
if have intentservice updates sharedpreference
, (partial) wakelock
needed?
i understand wakelock
keeps cpu awake, when needed?
if need keep cpu running in order complete work before device goes sleep, can use powermanager system service feature called wake locks. wake locks allow application control power state of host device.
creating , holding wake locks can have dramatic impact on host device's battery life. should use wake locks when strictly necessary , hold them short time possible. example, should never need use wake lock in activity.
one legitimate case using wake lock might background service needs grab wake lock keep cpu running work while screen off. again, though, practice should minimized because of impact on battery life.
unfortunately, poorly-coded, malicious, or buggy apps might create abnormal amount of undesirable wakelocks. other apps require constant internet access in order operate in normal fashion - facebook , messenger popular representatives. persistently request information web (the so-called "polling" new events), causing subsequent wakelocks.
in other cases, update given app can cause issues, result in partial wakelocks. latter keep cpu humming in background, without knowledge, , prevent device "going sleep". that's pretty substantial prerequisite anomalous battery drain. thus, advisable regularly monitor wakelocks on device , see of apps go harsh on our system's resources.
read more at:
what-are-wakelocks-how-they-affect-the-battery-life-of-your-android-device-and-how-to-greenify
reference: https://developer.android.com/training/scheduling/wakelock.html
Comments
Post a Comment