Wake Lock // Screen Awake

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.
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?

1 Like

Hi @doordewar;

I don’t know if I can help you but I tried to use the WAKE_LOCK to stop the brightness attenuation 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 :smiley:

1 Like