Example usage for android.os Environment getDataDirectory

List of usage examples for android.os Environment getDataDirectory

Introduction

In this page you can find the example usage for android.os Environment getDataDirectory.

Prototype

public static File getDataDirectory() 

Source Link

Document

Return the user data directory.

Usage

From source file:com.miz.functions.MizLib.java

@SuppressWarnings("deprecation")
public static long getFreeMemory() {
    StatFs stat = new StatFs(Environment.getDataDirectory().getPath());
    if (hasJellyBeanMR2())
        return stat.getAvailableBlocksLong() * stat.getBlockSizeLong();
    else/*from   w w w.j  av  a 2  s . c o  m*/
        return stat.getAvailableBlocks() * stat.getBlockSize();
}