views:

156

answers:

1

I'm able to play a media using a MediaPlayer.

But how can I play the media with speaker phone only? I have tried:

AudioManager audioManager = (AudioManager) mActivity.getSystemService(Context.AUDIO_SERVICE);
audioManager.setSpeakerphoneOn(true);

That does not work. And I have add this to my Manifest file

<uses-permission android:name="android.permission.MODIFY_AUDIO_SETTINGS" />

Can someone please tell me what am i missing?

A: 

Hope this helps.

sbidwai
i know how to play a media file via Mediaplayer. I just want it to play it via speakersphone. Setting this does not help.AudioManager audioManager = (AudioManager) mActivity.getSystemService(Context.AUDIO_SERVICE); audioManager.setSpeakerphoneOn(true);
hap497
The link doesn't address the question (in which I happen to be very interested).
dhaag23