Currently I am working a project where I have to get access to the Music directory which can be found in the Root. I am trying to get the directory with the Phonegap/Cordova plugin: https://github.com/apache/cordova-plugin-file
I tried many things and I did research on Google but couldn't find anything good.. Here is my code:
/* THIS IS PLACED IN THE onDeviceReady FUNCTION! */
window.requestFileSystem(window.TEMPORARY, 1024*1024, onFileSystemSuccess, function(e) { alert("Something went wrong.."); });
alert( "5" );
/*************************************************/
function onFileSystemSuccess(fileSystem) {
alert("6"); // just for testing
fileSystem.root.getDirectory("Music", {}, getDirSuccess, function(e) { alert("Doesn't work"); } );
}
function getDirSuccess(dirEntry) {
alert("7");
var directoryReader = dirEntry.createReader();
directoryReader.readEntries(readerSuccess,fail);
}