Java tutorial
//package com.java2s; import android.media.AudioManager; public class Main { private static void setVolume(AudioManager manager, int audioStream, int setValue) { int volume = manager.getStreamMaxVolume(audioStream) * setValue / 100; manager.setStreamVolume(audioStream, volume, AudioManager.FLAG_REMOVE_SOUND_AND_VIBRATE); } }