title: Android, how to route the audio to speakers when headphones inserted?
body: <p>I am looking for a way to play audio from an Android device's speaker, even when headphones are inserted.</p>
  
  <p>In fact, the typical behavior is that, when headphones are inserted, no audio is outputted form the speakers. However some apps, such the default Clock app (com.google.android.deskclock), are able to route the audio to the speaker even when the headphones are inserted.</p>
  
  <p>How can I programmatically get this behavior?</p>
  
  <p>I am looking for a solution that works (at least) on Nexus 5 devices, running KitKat (Android 4.4)</p>
  
  <p>Thanks.</p>