Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;
//License from project: Apache License 

import android.media.AudioManager;

public class Main {
    public static int getAlarmVolumeFromPercentage(AudioManager audioManager, int audioStream, float percentage) {
        int volume = (int) Math.ceil((double) audioManager.getStreamMaxVolume(audioStream) * (percentage / 100.0d));
        return volume;
    }
}