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!