4

So in my application, I have a seekbar that allows the user to set the ringer volume (0 - 100). I can't seem to find a way to set the ringer volume to a specified number. I looked through the AudioManager class but it tells me to either set ringermode to normal/silent/vibrate. That is NOT what I want. I want the volume to be a specific number. Here's an example of what I'm looking for:

private void setRinger (int volume) // volume = 0 - 100
{
    setRingVolume (volume); // Whenever a person gets a call/sms/warning/anything etc., it should be this volume.
}

Is this possible in Android? If so, how? Can you give me an example of how I can do this?

Thank you.

androidNoob
  • 229
  • 1
  • 3
  • 9

1 Answers1

8

Look up the AudioManager (documentation here). It should have everything you need, including setVibrateSetting, setRingerMode, setStreamVolume. All those settings are separate from each other.

EboMike
  • 76,846
  • 14
  • 164
  • 167
  • Hi, please check my edited post. I don't think you understood what I was looking for the first time. – androidNoob Nov 28 '10 at 05:16
  • I don't think you understood my answer :) What about `setStreamVolume` doesn't solve the problem? – EboMike Nov 28 '10 at 05:21
  • Ah, I see. Yes it does! Thank you very much! Sorry for the misunderstanding, I kept looking at setRingerMode. – androidNoob Nov 28 '10 at 05:31
  • Ha, in your defense, that function name is VERY cryptic, to say the least. I had to look twice myself. I hope this does the trick for you! Good luck! – EboMike Nov 28 '10 at 05:35