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 java.io.File;

import android.os.Environment;
import android.os.StatFs;

public class Main {
    public static final StatFs mStatFs = new StatFs(Environment.getDataDirectory().getPath());

    public static long getAvailableInternalMemorySize() {
        File path = Environment.getDataDirectory();
        mStatFs.restat(path.getPath());
        long blockSize = mStatFs.getBlockSize();
        long availableBlocks = mStatFs.getAvailableBlocks();
        return availableBlocks * blockSize;
    }
}