I'm working on an android app based on phonegap 4.0 & wikitude. I want to create a folder on root (/storage/emulated/0/ or /storage/sdcard0 if there's a SD). The piece of code for doing that is:
onDeviceReady: function() {
app.receivedEvent('deviceready');
window.requestFileSystem(LocalFileSystem.PERSISTENT, 0, gotFS, fail);
app.wikitudePlugin = cordova.require("com.wikitude.phonegap.WikitudePlugin.WikitudePlugin");
app.wikitudePlugin.isDeviceSupported(app.onDeviceSupportedCallback, app.onDeviceNotSupportedCallback);
},
gotFS: function(fileSystem) {
alert( "Got the file system: "+fileSystem.name +"<br/>" +
"root entry name is "+fileSystem.root.name + "<p/>");
fileSystem.root.getDirectory("ARMedia", {create: true}, gotDir, fail);
},
gotDir: function(dirEntry) {
file.entry = fileEntry;
alert('Folder ARMedia created!');
},
fail: function(error) {
alert(error);
},
The problem is that when I test on my devices (xiaomi mi3 and a Samsung galaxy tab 2) the app is stuck on "window.requestFileSystem(LocalFileSystem.PERSISTENT, 0, gotFS, fail);"
The plugins for file-transfer and file are already in my plugins folder, the android manifest.xml has the permission of WRITE_EXTERNAL_STORAGE and I've tried all almost everything... I just want to know why the program doesn't go farther of window.requestFileSystem.
Thanks and sorry for my bad english.