get Alarm Max Sound - Android Phone

Android examples for Phone:Sound

Description

get Alarm Max Sound

Demo Code


//package com.java2s;

import android.content.Context;

import android.media.AudioManager;

public class Main {

    public static int getAlarmMaxSound(Context context) {
        int max = 0;
        try {/* w  w  w .  j av  a2 s.  c  o m*/
            AudioManager manager = (AudioManager) context
                    .getSystemService(Context.AUDIO_SERVICE);
            max = manager.getStreamMaxVolume(AudioManager.STREAM_ALARM);
        } catch (Exception e) {
        }
        return max;
    }
}

Related Tutorials