Code example for AudioManager

Methods: getRouting

0
	    Log.e("AudioHandler setAudioOutputDevice", " unknown output device");	
    } 
	 
    protected int getAudioOutputDevice(){ 
	AudioManager audiMgr = (AudioManager) mCtx.getSystemService(Context.AUDIO_SERVICE);
	if (audiMgr.getRouting(AudioManager.MODE_NORMAL) == AudioManager.ROUTE_EARPIECE)
	    return 1; 
	else if (audiMgr.getRouting(AudioManager.MODE_NORMAL) == AudioManager.ROUTE_SPEAKER)
	    return 2; 
	else 
	    return -1; 
    } 
}