CreateFolder();
function CreateFolder(){
window.requestFileSystem(LocalFileSystem.PERSISTENT, 0, creatingFolder, error);
}
function creatingFolder(fileSystem) {
var entry = fileSystem.root;
entry.getDirectory("myNewDirectory", {create: true, exclusive: false}, win, error);
window.newfolder = fileSystem.root.toURL()+"/myNewDirectory";
}
function win(dir) {
alert("Created dir with name: "+dir.name);
alert("Created dir at: "+dir.toURL());
alert("Created dir NativePath: " + dir.nativeURL);
alert('done '+window.newfolder);
}
function error(error){
alert('hmm: '+error.code+' message: '+error.message);
}
Ok, so i can create this directory inside a real android device. My big confusion is after creating this folder, how do i access this [myNewDirectory]
folder from my Android device because the location of this directory looks like file:///data/data/com.packagename/files/files/myNewDirectory
I want my app users to download file and store inside [myNewDirectory] folder. So, they need a way to access all the downloaded files after
they close the app. How do i allow my app to create a folder inside my android device sdcard.
Something like this:
function creatingFolder(fileSystem) {
var entry = fileSystem.root;
entry.getDirectory(cordova.file.externalRootDirectory+"myNewDirectory", {create: true, exclusive: false}, win, error);
}
This code doesn't work though.
Need some help here, its been two days now, wrapping my head with lots of online resources, still no success.
Thanks.