Uploaded image for project: 'Apache Cordova'
  1. Apache Cordova
  2. CB-8619

window.requestFileSystem callback hangs on Samsung S3 and S3 mini devices

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Cannot Reproduce
    • None
    • None
    • cordova-android
    • Cordova 4.3; Android 4.3; Samsung Galaxy SIII, SIII mini; Developed on Windows 8.1 64-bit;

    Description

      The callback supplied to the window.requestFileSystem function (success or failure) does not fire when using Samsung Galaxy S3s and S3 minis after prolonged use of my app. I use window.requestFileSystem as part of a storage read function to read saved referential JSONlite data. Initially, it will function perfectly normally for calls, returning information as usual. Then after several calls and moderately intensive read/write calls, it will hang the application and not call the callbacks. Again, this only happens in one particular part of the application which requires reading around 15 JSONlite data files between a few bytes and <100kb in size. Subsequent functions which access the directory files therefore also cannot run.

      Running the application and replicating the behaviour with Eclipse LogCat Logging activated does not return any obvious errors that would indicate a problem.

      As I said this happens only for Samsung S3 and S3 minis not on any iOS devices or other Android devices (such as S4s, Notes and other devices with superior performance).

      The application is running the latest version of Cordova (4.3).

      Sample snippets are below:

      function getFilesystem() {
      console.log("FS: Getting file system");
      window.requestFileSystem(LocalFileSystem.PERSISTENT, 0, getWorkingDirectory, fail);
      }

      function getWorkingDirectory(fileSystem) {
      console.log("FS: Got the file system - getting the app directory");
      fileSystem.root.getDirectory("app",

      {create: true, exclusive: false}

      , gotWorkingDirectorySuccess, fail);
      }

      function gotWorkingDirectorySuccess(dir) {
      console.log("FS: Got the directory: " + dir.name);
      console.log("FS: Assigning the received directory");
      directory = dir;
      console.log("FS: Global directory name: " + directory.name);
      console.log("FS: Getting the file");
      getFile();
      }

      function fail(error) {
      endLoad();
      appError('We had some trouble getting some required information. Please restart the app and try again.');
      }

      Attachments

        Activity

          People

            Unassigned Unassigned
            tengland Thomas England
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: