I'm trying to create a folder on external storage with no success.Although i've managed to create a folder in my app's directory, i can't do the same for external storage and i also get false
when i call canWrite()
.I have declared the WRITE_EXTERNAL_PERMISSION
on manifest.
Here is my code for my app's directory
File file1=new File(context.getFilesDir(), "//test1");
file1.mkdir();
System.out.println(file1.canWrite());
and for ExternalStorage respectively
File file2=new File(Environment.getExternalStorageDirectory(), "//test2");
file2.mkdir();
System.out.println(file2.canWrite());
In the first case the folder gets created and i get true on println.On the second one folder does not get created and i get false on println.