Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android Wear Prevent Sleep

I'm writing a small wear app that is required to be quick access for around 10 - 15 minutes at a time. Problem is when the watch sleeps (screen completely blacks out) you have to go back into the start app screen to get back to it.

The data is retained so this is more of an annoying than anything else. Is there anyway to have the watch only dim the screen but not turn it "off" until the user dismisses the app?

like image 504
Flatlyn Avatar asked Jul 30 '14 11:07

Flatlyn


1 Answers

Please take a look at a session from Google I/O 2014:
https://www.youtube.com/watch?v=sha_w3_5c2c#t=1241 <- 20:42

Justin talks there about android:keepScreenOn="true" attribute to prevent the timeout and "back to homescreen" behavior.

Please read more info about keeping screen on here: https://developer.android.com/training/scheduling/wakelock.html#screen

like image 56
Maciej Ciemięga Avatar answered Nov 15 '22 22:11

Maciej Ciemięga