2

A native Android app has ways to do this: How do I prevent an Android device from going to sleep programmatically?

But my question: What about a web app running on an android device?

Aside: In iOS, according to iOS web app: prevent screen dimming/locking there isn't any way to... which is too bad. If someone knows otherwise, share your knowledge please!

Community
  • 1
  • 1
dmonopoly
  • 3,251
  • 5
  • 34
  • 49

1 Answers1

2

Perhaps at some time in the future this JavaScript API will be supported:

windows.screen.keepAwake = true;

Until then, you would have to wrap a WebView in an app that can bind to JavaScript events.

Ken Y-N
  • 14,644
  • 21
  • 71
  • 114