I want to create a separate directory for images saved via my app. But I don't know where my code falls short. This is what I am doing to create a new directory in the root directory of external storage:
File root = Environment.getExternalStorageDirectory();
File directory = new File(root,"MYFOLDER");
if(!directory.exists()) {
directory.mkdirs();
}
I have already added the <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
permission in my app manifest file. And I have tried this, this and this and others but nothing works.