Page turner and locked screen

Hello everyone,

In parallel with my previous post, I am working on plan B of my application with the use of a bluetooth “page turner” pedal rather than the voice recognition (too many problems with this method).

Even if its functions are limited, it do the job.

The bluetooth function has not needed to be included in the app so far and it works well with my phone when the screen is on.

However, I would like to be able to use the application even when the screen is off, or locked. If I have read well the various posts related to this kind of functions, it would be necessary to implement a "foreground service".

Unfortunately, I can't find on the forum or elsewhere, either the corresponding extension, or an example that uses this function.

Thanks in advance for the help
Caller_copy.aia (6.8 KB)