I am trying to get my android app to check if the device's volume (media, not ringer) is lower than 'x' percent, but I am unsure how. I am currently trying this:
AudioManager am = (AudioManager) getSystemService(AUDIO_SERVICE);
int volume = am.getStreamVolume(AudioManager.STREAM_MUSIC);
if (volume <0.7) {message};
Edit: I want the percentage of the volume, such as 10%/20%...