get Music Sound - Android Phone

Android examples for Phone:Sound

Description

get Music Sound

Demo Code


//package com.java2s;

import android.content.Context;

import android.media.AudioManager;

public class Main {

    public static int getMusicSound(Context context) {
        int current = 0;
        try {//from ww w  .j ava 2 s .  c om
            AudioManager manager = (AudioManager) context
                    .getSystemService(Context.AUDIO_SERVICE);
            current = manager.getStreamVolume(AudioManager.STREAM_MUSIC);
        } catch (Exception e) {
        }
        return current;
    }
}

Related Tutorials