How to programmatically turn on loudspeaker when make/receiving call?
<p>Hey..I am quite new to android and still in learning process..currently i plan to make a app which will automatic turn on loudspeaker when the call is connected..and below are the codes..</p>

<pre><code>audiomanager = (AudioManager) contex.getSystemService(Context.AUDIO_SERVICE);

  @Override
    public void onCallStateChanged(int state, String incomingNumber) {
               case TelephonyManager.CALL_STATE_OFFHOOK:
                           am.setSpeakerphoneOn(true); 
               break;
         }
</code></pre>

<p>i was testing my code on android 2.1..sdk 7..i thaught using audiomanager.setSpeakerphoneOn(true); and add the permission of MODIFY_AUDIO_SETTINGS in manifest can turn on the loudspeaker..but it seems like it cant...so anyone can help?? thanks in advance..</p>
