{"action":"created","issue":{"url":"https://api.github.com/repos/apache/cordova-plugin-file/issues/239","repository_url":"https://api.github.com/repos/apache/cordova-plugin-file","labels_url":"https://api.github.com/repos/apache/cordova-plugin-file/issues/239/labels{/name}","comments_url":"https://api.github.com/repos/apache/cordova-plugin-file/issues/239/comments","events_url":"https://api.github.com/repos/apache/cordova-plugin-file/issues/239/events","html_url":"https://github.com/apache/cordova-plugin-file/issues/239","id":351109448,"node_id":"MDU6SXNzdWUzNTExMDk0NDg=","number":239,"title":"Not seeing files that are stored on the Android device","user":{"login":"phil4literacy","id":14092181,"node_id":"MDQ6VXNlcjE0MDkyMTgx","avatar_url":"https://avatars2.githubusercontent.com/u/14092181?v=4","gravatar_id":"","url":"https://api.github.com/users/phil4literacy","html_url":"https://github.com/phil4literacy","followers_url":"https://api.github.com/users/phil4literacy/followers","following_url":"https://api.github.com/users/phil4literacy/following{/other_user}","gists_url":"https://api.github.com/users/phil4literacy/gists{/gist_id}","starred_url":"https://api.github.com/users/phil4literacy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/phil4literacy/subscriptions","organizations_url":"https://api.github.com/users/phil4literacy/orgs","repos_url":"https://api.github.com/users/phil4literacy/repos","events_url":"https://api.github.com/users/phil4literacy/events{/privacy}","received_events_url":"https://api.github.com/users/phil4literacy/received_events","type":"User","site_admin":false},"labels":[{"id":1018147009,"node_id":"MDU6TGFiZWwxMDE4MTQ3MDA5","url":"https://api.github.com/repos/apache/cordova-plugin-file/labels/platform:%20android","name":"platform: android","color":"c2e0c6","default":false},{"id":1025990152,"node_id":"MDU6TGFiZWwxMDI1OTkwMTUy","url":"https://api.github.com/repos/apache/cordova-plugin-file/labels/support","name":"support","color":"0e8a16","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":5,"created_at":"2018-08-16T08:41:01Z","updated_at":"2018-10-01T08:54:18Z","closed_at":null,"author_association":"NONE","body":"The issue has been described in this question: \r\nhttps://stackoverflow.com/questions/42490558/not-seeing-files-that-are-store-on-the-android-device-using-cordova-file-plugin\r\n\r\nI'm facing the same issue and was only able to solve it by downgrading to Android API 22 as the author in the Stackoverflow question did. \r\n\r\nWhen looping through all directories on the phone, it will only see files in the directory where the app is stored, but not files stored for example in the download folder of the SD Card.\r\n\r\nThis is my function:\r\n```\r\n var localURLs    = [\r\n      this.file.cacheDirectory,\r\n      this.file.applicationDirectory,\r\n      this.file.applicationStorageDirectory,\r\n      this.file.dataDirectory,\r\n      this.file.documentsDirectory,\r\n      this.file.externalApplicationStorageDirectory,\r\n      this.file.externalCacheDirectory,\r\n      this.file.externalRootDirectory,\r\n      this.file.externalDataDirectory,\r\n      this.file.sharedDirectory,\r\n      this.file.syncedDataDirectory\r\n    ];\r\n loopThroughDirectories(localURLs, function(){\r\n    });\r\n\r\nfunction loopThroughDirectories(localURLs, callback) {\r\n      for (i = 0; i < localURLs.length; i++) {\r\n\r\n        console.log(\"directory: \" + localURLs[i]);\r\n        if(i == (localURLs.length - 1))\r\n        {\r\n          loading.dismiss();\r\n          callback();\r\n        }\r\n        if (localURLs[i] === null || localURLs[i].length === 0) {\r\n          continue; // skip blank / non-existent paths for this platform\r\n        }\r\n        window.resolveLocalFileSystemURL(localURLs[i], addFileEntry, addError);\r\n      }\r\n    }\r\n\r\nvar that = this;\r\n    var addFileEntry = function (entry) {\r\n      console.log(\"addFileEntry\");\r\n      var dirReader = entry.createReader();\r\n      dirReader.readEntries(\r\n        function (entries) {\r\n          console.log(\"nr of entries: \" + entries.length);\r\n          var i;\r\n          for (i = 0; i < entries.length; i++) {\r\n            console.log(entries[i].fullPath);\r\n            if (entries[i].isDirectory === true) {\r\n              // Recursive -- call back into this subdirectory\r\n              addFileEntry(entries[i]);\r\n            } else {\r\n              if(entries[i].fullPath.endsWith(\".apkg\") && entries[i].fullPath.search(\"/AnkiDroid/\") == -1)\r\n              {\r\n                console.log(i + \": \" + entries[i].fullPath);\r\n                that.arrFiles.push({nr: i, fullPath: entries[i].fullPath, nativeURL: entries[i].nativeURL}); \r\n              }\r\n            }\r\n          }\r\n        },\r\n        function (error) {\r\n          console.error(\"readEntries error: \" + error.code);\r\n        }\r\n      );\r\n    };\r\n\r\n var addError = function (error) {\r\n      console.error(\"getDirectory error: \" + error.code);\r\n    };\r\n```\r\n\r\nIt's used in this project for finding all files on a phone with the apkg extension:\r\nhttps://github.com/phil4literacy/TeachMeWords"},"comment":{"url":"https://api.github.com/repos/apache/cordova-plugin-file/issues/comments/425834677","html_url":"https://github.com/apache/cordova-plugin-file/issues/239#issuecomment-425834677","issue_url":"https://api.github.com/repos/apache/cordova-plugin-file/issues/239","id":425834677,"node_id":"MDEyOklzc3VlQ29tbWVudDQyNTgzNDY3Nw==","user":{"login":"janpio","id":183673,"node_id":"MDQ6VXNlcjE4MzY3Mw==","avatar_url":"https://avatars0.githubusercontent.com/u/183673?v=4","gravatar_id":"","url":"https://api.github.com/users/janpio","html_url":"https://github.com/janpio","followers_url":"https://api.github.com/users/janpio/followers","following_url":"https://api.github.com/users/janpio/following{/other_user}","gists_url":"https://api.github.com/users/janpio/gists{/gist_id}","starred_url":"https://api.github.com/users/janpio/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/janpio/subscriptions","organizations_url":"https://api.github.com/users/janpio/orgs","repos_url":"https://api.github.com/users/janpio/repos","events_url":"https://api.github.com/users/janpio/events{/privacy}","received_events_url":"https://api.github.com/users/janpio/received_events","type":"User","site_admin":false},"created_at":"2018-10-01T08:54:18Z","updated_at":"2018-10-01T08:54:18Z","author_association":"NONE","body":"It has not been abandoned, there is just a pretty massive backlog of stuff in general regarding Cordova core plugins that has to be taken care of. I am currently working through all the testing issues for example: https://github.com/apache/cordova/issues/28"}}
{"actor":{"display_login":"janpio"}}