I've built a simple audio player, it's plays several OGG tracks of an audio-book.
I would like to be able to have the screen go black, either after a certain amount of time, or if the user presses the power button, but still have the audio continue playing.
Right now, the app prevents the screen from dimming while the audio plays, ideal for a game but not for battery life.
When I press the power button on phone/tablet, it pauses the audio. I would like it to continue playing.
Does anyone know how to achieve that?
I think it may have something to do with the wakelock permission? or Screen sleep?