javascript - Can't get access to the root directory phonegap -
currently working project have access music directory can found in root. trying directory phonegap/cordova plugin: https://github.com/apache/cordova-plugin-file
i tried many things , did research on google couldn't find good.. here code:
/* placed in ondeviceready function! */ window.requestfilesystem(window.temporary, 1024*1024, onfilesystemsuccess, function(e) { alert("something went wrong.."); }); alert( "5" ); /*************************************************/ function onfilesystemsuccess(filesystem) { alert("6"); // 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); }
hmm... might want try window.resolvelocalfilesystemurl()
instead of window.requestfilesystem()
if you're looking read filesystem.
i've got sample routine iterates through bunch of directories here: how documents in android directory phonegap see. might narrow search.
Comments
Post a Comment