List of usage examples for android.os Environment getExternalStorageDirectory
public static File getExternalStorageDirectory()
From source file:Main.java
public static String getSdcardPath() { return Environment.getExternalStorageDirectory().getAbsolutePath(); }
From source file:Main.java
public static long freeSpaceOnSd() { StatFs stat = new StatFs(Environment.getExternalStorageDirectory().getPath()); long sdFreeMB = (long) stat.getAvailableBlocks() * stat.getBlockSize(); return sdFreeMB; }
From source file:Main.java
public static String getRootFilePath() { if (hasSDCard()) { return Environment.getExternalStorageDirectory().getAbsolutePath() + "/";// filePath:/sdcard/ } else {//from w w w. ja va 2s .c o m return Environment.getDataDirectory().getAbsolutePath() + "/data/"; // filePath: /data/data/ } }
From source file:Main.java
public static File getApkFile(String apkTitle) { File file = new File(Environment.getExternalStorageDirectory().getPath() + "/Download", apkTitle); return file;/* w w w .ja v a2 s . c om*/ }
From source file:Main.java
public static String getSDPath() { if (checkSDCardAvailabel()) { return Environment.getExternalStorageDirectory().getPath(); } else {//from w w w .j av a 2 s. com return Environment.getDownloadCacheDirectory().getPath(); } }
From source file:Main.java
public static void deleteCSV() { File myDir = new File(Environment.getExternalStorageDirectory() + "/Caffeine_Counter_History"); deleteRecursive(myDir);/* w w w. j av a 2 s. c o m*/ }
From source file:Main.java
static public void deleteAllSDContent() { String dir_path = Environment.getExternalStorageDirectory().getPath() + "/swift"; File f = new File(dir_path); if (f.isDirectory()) { String files[] = f.list(); for (int i = 0; i < files.length; i++) { new File(dir_path, files[i]).delete(); }//from w w w .ja v a 2 s . c om } }
From source file:Main.java
public static String getSdcardPath() { String sdcardPath = Environment.getExternalStorageDirectory().getAbsolutePath(); return sdcardPath; }
From source file:Main.java
public static String getExternalStorageDirectory() { return Environment.getExternalStorageDirectory().getAbsolutePath(); }
From source file:Main.java
public static URI getSDCardUri() { if (existSDCard()) return Environment.getExternalStorageDirectory().toURI(); else/*w w w . j av a 2 s . co m*/ return null; }