Phonegap Android LocalFileSystem is not defined-Collection of common programming errors
I have a problem for accessing Android File System for storage purpose in my phonegap application. I’ve searched and found lots of not-my-situation solutions!
I know about the necessity of deviceready to be fired and checked and it got fired. So the phonegap.js is loaded perfectly!
I think I requested the file permissions and have features in my manifest and config file. here they are:
config.xml:
AndroidManifest.xml:
and here is the error throwing part of my code:
$(document).ready(function () {
document.addEventListener("deviceready", onDeviceReady, false);
});
function onDeviceReady() {
window.requestFileSystem(LocalFileSystem.PERSISTENT, 0, function (fileSystem) { //throws the 'Uncaught ReferenceError: LocalFileSystem is not defined' error
fileSystem = fileSystem;
}, function (evt) {
alert(evt.target.error.code);
});
}
But I get the error for a reason I don’t have any idea about! Please give me your thought. I appreciate it very much.
PS: I’m using phonegap 3.0!