Android examples for Phone:Volume
get Voice Current Percent
//package com.java2s; import android.content.Context; import android.media.AudioManager; public class Main { public static int getVoiceCurrentPercent(Context context) { AudioManager mAudioManager = (AudioManager) context .getSystemService(Context.AUDIO_SERVICE); float max = (float) mAudioManager .getStreamMaxVolume(AudioManager.STREAM_MUSIC); float current = (float) mAudioManager .getStreamVolume(AudioManager.STREAM_MUSIC); float percent = current / max * 100; return (int) percent; }/*from w w w . jav a 2s. c om*/ }