Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;

import android.os.StatFs;

public class Main {
    public static float getLocalStorageSpace() {
        float space = 0;
        try {
            StatFs stat = new StatFs("/data/");
            space = stat.getAvailableBlocks() * (float) stat.getBlockSize();
        } catch (Exception e) {
            e.printStackTrace();
        }
        return space;
    }
}