• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

Forcing notifications to loudspeaker when headphones plugged in programatically.

califauna

Newbie
Hi,

Could someone suggest how I might go about forcing audio to the loudspeaker programatically when the headphones are plugged in?

Are there any commands that can be run in a shell like that available in the security settings plugin which could do this, or saved as a file and then run by tasker?

It seems this class in the Android APIs would be for that: AudioManager | Android Developers

Id like to know though if theres a way to do it without having to develop an app or get in so deep (even though the SDK there does look really impressive and beginner friendly)

Tasker and Sound About kind of works, but only if you force basically everything including media sounds through the speaker; also Im finding that as the Alarm is not recognised by tasker on my phone unless its by the %WIN variable, and sound around comes to the front then loads again when you press back to try and get at the alarm. Maybe theres a way around that but I dont see any way for the audio routing problem.

Phone is i9100 and ROMs are custom ROMs (now trying out RR Kit Kat).

Thanks.
 
Since the switching is normally done by a hardware switch in the headphone jack, that would be difficult. ("Difficult" meaning that you;d have to redesign the hardware in the phone.)
 
Since the switching is normally done by a hardware switch in the headphone jack, that would be difficult. ("Difficult" meaning that you;d have to redesign the hardware in the phone.)

Thanks but it is already possible to route the audio to the speakers with a device plugged into the headphones jack using Sound About, but it creates problems (described above).
 
Back
Top Bottom