Java tutorial
//package com.java2s; import java.io.File; public class Main { private static String T_FLASH_PATH = "/storage/sdcard1"; public static double getTFlashCardSpaceWhenInsertSdcard() { File dir; if (getStorageDirWhenInsertSdcard() != null) { dir = new File(T_FLASH_PATH); return dir.getTotalSpace() * 0.8; } return 0; } public static File getStorageDirWhenInsertSdcard() { File dir; try { dir = new File(T_FLASH_PATH, getMainDirName()); } catch (Exception e) { return null; } if (!dir.exists()) { dir.mkdirs(); } return dir; } public static String getMainDirName() { return "/aiowner"; } }