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