We are working on a Cordova project where we are developing an app for Android. 
The app is working good, but for certain functionalities to work properly, we 
need to access index.js file located in parent-folder/www/js/index.js. We added 
our modifications there, but nothing from index.js is getting called. We have a 
simple console.log, which also we don't see. What are we missing?

index.js : 
```

var app = {
    // Application Constructor
    initialize: function() {
        document.addEventListener('deviceready', this.onDeviceReady.bind(this), 
false);
    },

    // deviceready Event Handler
    //
    // Bind any cordova events here. Common events are:
    // 'pause', 'resume', etc.
    onDeviceReady: function() {
        console.log("i am so ready for u boyyyzzz!");
        this.receivedEvent('deviceready');
        window.addEventListener("click", function(event){
            var closestA = event.closest("a");
            //if(closestA && closestA.href && 
(closestA.getAttribute("download") !== undefined) && 
(closestA.getAttribute("download") !== null)){
                var fileTransfer = new FileTransfer();
                var uri = encodeURI(closestA.href);
                var fileURL =  "///storage/emulated/0/DCIM/myFile";

                fileTransfer.download(
                      uri, fileURL, function(entry) {
                         console.log("download complete: " + entry.toURL());
                      },

                      function(error) {
                         console.log("download error source " + error.source);
                         console.log("download error target " + error.target);
                         console.log("download error code" + error.code);
                      }

                   );
            //}
        });
    },
```
This is causing us a lot of issues as none of our external functions, 
especially download seems to be working. What are we doing wrong. Any insight 
would help, we are stuck on this for 2 days. Thank you. 

[ Full content available at: 
https://github.com/apache/cordova-android/issues/482 ]
This message was relayed via gitbox.apache.org for [email protected]

Reply via email to