How to activate sound on speaker when click on button

Hi,
I’m new on Kodular and it’es a great web app to develop on Android.
I have one question.
I’m codind an application like phone caller. and on this app i have one button.
When i touch it, i want to redirect sound from my call to my phone speaker.
Is it exiting one solution on Kodular to do it?
Thanks
Fabien, a French user of Kodular.

I asked ChatGPT for you and below is the answer
Taifun


You cannot programmatically force an active phone call to the speaker unless your app is the default dialer or provides an InCallService.
For normal third-party apps (even sideloaded, targetSdk 35), Android blocks this for privacy/security.

What is allowed on Android 14 / 15 (targetSdk 35)
:one: If your app is NOT the default dialer
:cross_mark: You cannot redirect call audio to speaker
:cross_mark: You cannot control in-call routing
:cross_mark: AudioManager.setSpeakerphoneOn(true) will not work for calls
:cross_mark: setCommunicationDevice() will be ignored
This is enforced at the framework + Telecom layer.
Being sideloaded or not on Google Play does not change anything.

Why Android blocks this
Google explicitly prevents:
Call spying
Forced audio rerouting
Accessibility abuse
Malware recording calls via speaker
This restriction applies equally to:
Play Store apps
Sideloaded apps
Enterprise apps (unless device-owner)