enguerranws
enguerranws

Reputation: 8233

Cordova : How to check if File API works?

As I am having real troubles debugging an app in Android / iOs, can someone tell me some simple test to check if Cordova File API is loaded and works ?

Something like:

        document.addEventListener("deviceready", onDeviceReady, false);
        function onDeviceReady() {
            if(fileAPI){ // what can I test there ?
                 alert('File API is OK');
            }
        }

Upvotes: 0

Views: 54

Answers (1)

jcesarmobile
jcesarmobile

Reputation: 53301

Try to request the FileSystem

window.requestFileSystem(LocalFileSystem.PERSISTENT, 0, function(fs) {
                                 alert("it works");
                                 }, function (e) {
                                 alert("it doesn't work");
                                 });

Upvotes: 1

Related Questions