How to keep screen OR use Wake lock feature in a Qt Quick and QML application for Android using Qt 6?
-
As the question is stating, I have a QT Quick application where I use QML for both the QUI and Backend. Now my application is quite straightforward and contains a timer that needs to keep counting down so I wanted to keep the screen on while the app is running.
One solution is to use the android Wake Lock feature that keeps the app running if the screen is turned off. But the issue is that when I looked this up for Qt I found that the library called "Qt Android Extras" is available up until Qt 5+ but not Qt 6. Unless I'm wrong which is why I'm asking for details.
The reason being the timer pauses if the screen turns off and the timing is critical, thus it needs to keep counting no matter what.
This is my first Android app using Qt so I'm not familiar with what I should be doing, so what should I do or what am I missing?