title: Android: Set maximum volume
body: <p>I am creating simple alarm application which tests if user does not move with device. If does, Service plays alarm sound.</p>
  
  <p>Problem is, if user set volume to some low values (or mute it). Even if I use this next code, my application uses this volume setting.</p>
  
  <pre><code>player = MediaPlayer.create(this, R.raw.sound);
  audioManager = (AudioManager)getSystemService(AUDIO_SERVICE);
  userVolume = this.audioManager.getStreamVolume(AudioManager.STREAM_ALARM);
  
  audioManager.setStreamVolume(AudioManager.STREAM_ALARM, this.audioManager.getStreamMaxVolume(AudioManager.STREAM_ALARM), AudioManager.FLAG_PLAY_SOUND);
  </code></pre>
  
  <p>Is there a way how to set "master" volume?</p>