List of utility methods to do SDCard Root Get
String | getExternalCacheDir(Context context) get External Cache Dir if (hasExternalCacheDir()) { return context.getExternalCacheDir().getPath() + File.separator + "gesture"; final String cacheDir = "/Android/data/" + context.getPackageName() + "/cache/gesture/"; return Environment.getExternalStorageDirectory().getPath() + cacheDir; ... |
String | getRootFilePath() get Root File Path if (hasSDCard()) { return Environment.getExternalStorageDirectory() .getAbsolutePath() + "/"; } else { return Environment.getDataDirectory().getAbsolutePath() + "/data/"; |
String | getSDCardRoot() get SD Card Root return Environment.getExternalStorageDirectory().getAbsolutePath()
+ File.separator;
|
File | getOutputMediaFile() get Output Media File File mediaStorageDir = new File( Environment .getExternalStoragePublicDirectory(Environment.DIRECTORY_PICTURES), "ThanksAndroid"); if (!mediaStorageDir.exists()) { if (!mediaStorageDir.mkdirs()) { Log.d("MyCameraApp", "failed to create directory"); return null; ... |
File | getOutputMediaFile(int type) Creates a media file in the Environment.DIRECTORY_PICTURES directory. if (!Environment.getExternalStorageState().equalsIgnoreCase( Environment.MEDIA_MOUNTED)) { return null; File mediaStorageDir = new File( Environment .getExternalStoragePublicDirectory(Environment.DIRECTORY_PICTURES), "CameraSample"); ... |
Uri | getOutputMediaFileUri() get Output Media File Uri File mediaStorageDir = new File( Environment .getExternalStoragePublicDirectory(Environment.DIRECTORY_PICTURES), "MyCameraApp"); if (!mediaStorageDir.exists()) { if (!mediaStorageDir.mkdirs()) { Log.d("MyCameraApp", "failed to create directory"); return null; ... |