Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>I've researched this and unfortunately I can't find any API support for detecting whether an earpiece exists.</p> <p>I've now raised this with Google as a feature request:<br> <a href="http://code.google.com/p/android/issues/detail?id=37623" rel="nofollow noreferrer">http://code.google.com/p/android/issues/detail?id=37623</a></p> <p>If you agree with the feature, click on the star at the bottom of the Google issue page to vote for it!</p> <p>Lots of users have raised the issue that Google Talk doesn't offer a speaker/earpiece toggle option, which perhaps suggests the absence of a suitable API...<br> <a href="http://code.google.com/p/android/issues/detail?id=19221" rel="nofollow noreferrer">http://code.google.com/p/android/issues/detail?id=19221</a></p> <p>As a workaround you may wish to hide the feature on devices approximated by (all of these approaches have drawbacks):</p> <ul> <li>those with extra large screens (i.e. tablets)</li> <li>those with no telephony support</li> <li>use a configurable white/blacklist of the main devices that do not have an earpiece.</li> </ul> <p>FTR, if you use <a href="https://stackoverflow.com/a/4663831/112705">this answer</a> to route audio to the earpiece, there don't seem to be any negative side affects running that code on the Xoom (OS 3.1) or the Samsung Galaxy Tab (OS 2.2) - the audio just continues to play through the external speaker. I haven't had a chance to test if there are any interactions with Bluetooth headsets yet.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload