# Wake Lock // Screen Awake

**URL:** <https://discourse.processing.org/t/wake-lock-screen-awake/14745>\
**Category:** Processing for Android\
**Created:** [October 16, 2019, 2:25pm UTC](https://discourse.processing.org/t/wake-lock-screen-awake/14745 "2019-10-16T14:25:38Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![doordewar](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/doordewar/32/2708_2.png) [@doordewar](https://discourse.processing.org/u/doordewar)\
**Post date:** [October 16, 2019, 2:25pm UTC](https://discourse.processing.org/t/wake-lock-screen-awake/14745/1 "2019-10-16T14:25:39Z")

</div>

Hey droids,

I would like to ask if anyone here has experience with using WAKE\_LOCK on android applications. I have made an interactive application with audio (Processing Sound libraries) and the magnet sensor (Ketai). Now, I don’t actually need to use the screen, but I am currently using a FLAG\_KEEP\_SCREEN\_ON activity to keep the app running for a long time (phone connected to external battery).

**Is using WAKE\_LOCK instead of SCREEN\_ON better for battery life?**  
I learned SCREEN\_ON is an activity and WAKE\_LOCK is a service, [https://developer.android.com/training/scheduling/wakelock#java](https://developer.android.com/training/scheduling/wakelock#java).  
**How to translate the android code for WAKE\_LOCK to processing?**  
If anyone would be willing to answer either of my questions or help shape the code, that’d be really nice! I think others could benefit as well.

PS Anyone know if there’s a proper guide for using android functions as found on their developer site in the processing environment?

---

<div class="post-metadata">

**Author:** ![Waboqueox](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/waboqueox/32/5643_2.png) [@Waboqueox](https://discourse.processing.org/u/Waboqueox)\
**Post date:** [October 16, 2019, 2:49pm UTC](https://discourse.processing.org/t/wake-lock-screen-awake/14745/2 "2019-10-16T14:49:33Z")

</div>

Hi @doordewar;

I don’t know if I can help you but I tried to use the WAKE\_LOCK [to stop the brightness attenuation](https://discourse.processing.org/t/evitar-la-atenuacion-del-brillo-al-cabo-de-un-rato-as/13796/2) and refering to the batery and wich one is better, In my opinion the SCREEN\_ON is better, because with the WAKE\_LOCK even if you have your app on the background, your device wont go to stand by, but with the SCREEN\_ON, if you are not using your app, the screen will go to sleep mode after a while.

Well, I don’t know much more about it, hope you find your answer 😃
