Reputation: 1
I wanted to create some folders and some files to /storage/MyFolder/
.
I had tried to work on using /storage/emulated/0/MyFolder
and it is working but i want to make hide under the storage root folder.
Is there any possible way for me to do this?
Upvotes: 0
Views: 8334
Reputation: 483
You can create folder like this in External Storage directory:
String folder_main = "NewFolder";
File f = new File(Environment.getExternalStorageDirectory(), folder_main);
if (!f.exists()) {
f.mkdirs();
}
Upvotes: 1
Reputation: 1256
//get path to external storage (SD card)
String iconsStoragePath = Environment.getExternalStorageDirectory() + "/Abc/";
File sdIconStorageDir = new File(iconsStoragePath);
//create storage directories, if they don't exist
if(!sdIconStorageDir.exists()){
sdIconStorageDir.mkdirs();
}
Upvotes: 0