How can I give a CPU wakelock to an app so that It can work even when the screen is off?

(Usually android halts CPU too, when screen is off)

  • Apps get wakelocks programmatically using PowerManager APIs. You can acquire and release a wakelock manually by writing a string to /sys/power/wake_lock and /sys/power/wake_unlock respectively. – Irfan Latif Mar 19 '19 at 4:52
  • @IrfanLatif Thank you! :) That's the answer, though I don't have root :( – KYHSGeekCode Mar 19 '19 at 8:08

If you don't have root access in your phone, there are many apps in the Play Store which can take a partial wake lock. Just start the app manually when you need it. Because, if one app takes a partial wake lock, other apps can also take the advantage.

  • Thanks, I didn't know that the wakelock affects other apps too. and I don't have root :) – KYHSGeekCode Mar 19 '19 at 8:09

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.