Impossible to play music through speakers and earphones on Android?

I asked this on xda-developers and on Reddit but so far, no clear answer.

I’d like to play music through both the speakers and earphones on my Samsung tablet for my friends. The answers I’ve gotten are that it’s not possible with the headphone jack inserted fully as the circuits cut power to the speakers. However, that doesn’t seem to explain why alarm applications from the PlayStore and the stock apps play music on both.

Someone did suggest that I could download a music app which did the same thing but not sure which ones would be able to do this. Is the only option a hardware mod?

The headphone jack does not cut any circuit on an android phone, least none that i know of, it is a software function. Not like an old transistor radio where it physically disconnects the speaker

Plug in headphones, they are electrically detected just like on most modern PC’s, and the application switches its output, the alarm is written to not switch outputs, there are a few other apps written this way as well, Firealert2 comes to mind.

I am not sure which music apps work this way, i just use pandora and google