I need to create a folder in internal memory root directory and create a file inside it, but cannot find the below code working.
String path = Environment.getRootDirectory().toString();
File mFolder = new File(path,"Folder");
if (!mFolder.exists()) {
boolean res = mFolder.mkdir();
}
And mkdir always return false. I already found getDataDirectory()
and getFilesDir()
but that I doesn't required. I need to create a directory where the internal memory root location(location we see first when we open internal memory)
Edit:
Root folder I mean the first location we see on internal memory open using file browser. Where I can see Download
,Pictures
,Android
etc..