Java tutorial
//package com.java2s; //License from project: LGPL import android.content.Context; import android.media.AudioManager; public class Main { public static int getStreamMaxVolume(Context context, int streamType) { AudioManager audioManager = getAudioManager(context); if (audioManager == null) return 0; return audioManager.getStreamMaxVolume(streamType); } public static AudioManager getAudioManager(Context context) { return (AudioManager) context.getSystemService(Context.AUDIO_SERVICE); } }