Reputation: 13421
As you can see in ss, some apps have created their own folders in my phone root folder.
So that means it's possible, but I couldn't find a way to do this.
Tried this but didn't work,
File folder = new File("/myfolder");
boolean success = true;
if (!folder.exists()) {
success = folder.mkdir();
}
Upvotes: 2
Views: 167
Reputation: 690
Java.IO.File folder = new Java.IO.File(
Android.OS.Environment.ExternalStorageDirectory, "dalisto/cache");
folder.Mkdir ();
Upvotes: 0
Reputation:
You need to get put the path to sdcard first, like this:
File folder = new File(Environment.getExternalStorageDirectory(), "myfolder");
folder.mkdir();
You don't need to check if folder exists, as mkdir() will just do nothing (and return false) in that case.
Upvotes: 1