Show app when lockscreen is turned on - Turn off Bluetooth-Connection

As a beginner, I ask for help with 2 questions:
Is it possible to check if the phone's speaker is turned off by connecting it to headphones? If YES, how can I activate the speaker, e.g. turn off the Bluetooth connection?

When a certain event occurs, how can I bring the app to the foreground when the lock screen is turned on or another app is in use?

Thank you in advance!

This extension might be helpful

What kind of event?

Probably kiosk mode can help?

https://community.appinventor.mit.edu/search?context=topic&context_id=122957&q=Kiosk%20order%3Alatest&skip_context=true

Taifun