1. Download our Official Android App: Forums for Android!

Forcing notifications to loudspeaker when headphones plugged in programatically.

Discussion in 'Android Apps & Games' started by califauna, Jan 23, 2014.

  1. califauna

    califauna Newbie
    Thread Starter
    Rank:
    None
    Points:
    36
    Posts:
    20
    Joined:
    Jan 23, 2014

    Jan 23, 2014
    20
    2
    36
    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.
     

    Advertisement

  2. Rukbat

    Rukbat Android Expert
    Rank:
    None
    Points:
    843
    Posts:
    10,392
    Joined:
    Jan 16, 2012

    Jan 16, 2012
    10,392
    2,894
    843
    Male
    Being retired and writing Tasker tasks.
    Fayetteville, NC, USA
    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.)
     
  3. califauna

    califauna Newbie
    Thread Starter
    Rank:
    None
    Points:
    36
    Posts:
    20
    Joined:
    Jan 23, 2014

    Jan 23, 2014
    20
    2
    36
    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).
     

Share This Page

Loading...