private static File getAlbumDir() { File storageDir = null; if (Environment.MEDIA_MOUNTED.equals(Environment.getExternalStorageState())) { storageDir = new File( Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_PICTURES), ApplicationLoader.applicationContext.getResources().getString(R.string.AppName)); if (storageDir != null) { if (!storageDir.mkdirs()) { if (!storageDir.exists()) { FileLog.d("tmessages", "failed to create directory"); return null; } } } } else { FileLog.d("tmessages", "External storage is not mounted READ/WRITE."); } return storageDir; }