I'm making an application that works like an alarm, the problem is that when I play the audio that I set as an alert if the headphones are connected it uses them as an audio output, how can I make it sound in the main speaker ignoring the hearing aids?
So I sound the audio:
MediaPlayer mp = MediaPlayer.create(this, R.raw.alarma);
mp.start();
Thanks for the help.