Android SDCard Check getRealSizeOnPhone()

Here you can find the source of getRealSizeOnPhone()

Description

get Real Size On Phone

License

Apache License

Declaration

public static long getRealSizeOnPhone() 

Method Source Code

//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 long getRealSizeOnPhone() {
        File path = Environment.getDataDirectory();
        StatFs stat = new StatFs(path.getPath());
        long blockSize = stat.getBlockSize();
        long availableBlocks = stat.getAvailableBlocks();
        long realSize = blockSize * availableBlocks;
        return realSize;
    }// w ww .  j  a va  2 s . com
}

Related

  1. enoughSpaceOnPhone(long updateSize)
  2. enoughSpaceOnSdCard(long updateSize)
  3. getRealSizeOnSdcard()
  4. hasExternalCacheDir()
  5. hasSDCard()
  6. hasSDCard()