How to Stop Your Android App from Draining the Battery with Wake Locks

## How to Stop Your Android App from Draining the Battery with Wake Locks

## How to Stop Your Android App from Draining the Battery with Wake Locks A wake lock is one of the simplest APIs in Android and one of the easiest to misuse. Acquiring one takes a single line of code. Forgetting to release it can keep a phone's CPU awake for hours, drain the battery overnight, and earn your app a warning label on Google Play. Most wake lock bugs aren't caused by a misunderstanding of the API itself. They come from ordinary control flow problems: an exception thrown between acquire() and release(), an early return, a callback that never fires, or a reference count that drifts…

Читать полностью →

Источник: freeCodeCamp

Подключаюсь к источникам…

30 главных источников
о мире ИИ

Автоматический перевод, курирование и красивая подача главных статей об искусственном интеллекте.

0
статей
0
источников
9
разделов