Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;
// Use of this source code is governed by a BSD-style license that can be

import android.os.Environment;

public class Main {
    private static final long STORAGE_ALMOST_FULL_THRESHOLD_BYTES = 10L * (1 << 20);

    /**
     * Returns true if the stoarge is almost full which indicates that the user probably needs to
     * free up some space.
     */
    public static boolean isStorageAlmostFull() {
        return Environment.getExternalStorageDirectory().getUsableSpace() < STORAGE_ALMOST_FULL_THRESHOLD_BYTES;
    }
}