i have written following code to create directory in android but it is not working.
File root = Environment.getExternalStorageDirectory();
File directory = new File(root.getAbsolutePath()+"/MYFOLDER");
file.mkdirs();
i have written following code to create directory in android but it is not working.
File root = Environment.getExternalStorageDirectory();
File directory = new File(root.getAbsolutePath()+"/MYFOLDER");
file.mkdirs();
This is how you can create a directory in Android:
File root = Environment.getExternalStorageDirectory();
File directory = new File(root.getAbsolutePath()+"/MYFOLDER");
If (!directory.exists){
directory.mkdirs();
}
Make sure you've permission granted to write external storage