Uploaded image for project: 'Titanium SDK/CLI'
  1. Titanium SDK/CLI
  2. TIMOB-28177

Android: createTempFile() should create file under Ti.Filesystem.tempDirectory

    Details

    • Story Points:
      3
    • Sprint:
      2020 Sprint 21

      Description

      Summary:
      On Android, the Ti.Filesystem.createTempFile() method creates the file under the root Ti.Filesystem.applicationCacheDirectory when it should be created under the Ti.Filesystem.tempDirectory instead like iOS.

      Steps to reproduce:

      1. Build and run the below code on Android.
      2. In the log, notice nativePath is immediately under the cache folder.

      var tempFile = Ti.Filesystem.createTempFile();
      console.log('@@@ nativePath: ' + tempFile.nativePath);
      console.log('@@@ tempDirectory: ' + Ti.Filesystem.tempDirectory);
      console.log('@@@ applicationCacheDirectory: ' + Ti.Filesystem.applicationCacheDirectory);
      

      Note:
      On Android, the tempDirectory is a subfolder under the applicationCacheDirectory. This is okay since Android does not natively support both of these folders. You are expected to put temp files under the app's sandboxed "cache" folder. However, Titanium should keep temp files under a separate temp subfolder so that we can clean it ourselves on app startup and let the Android OS clean the rest of the cached files when needed.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                jquick Joshua Quick
                Reporter:
                jquick Joshua Quick
                Reviewer:
                Gary Mathews
                Tester:
                Satyam Sekhri
              • Watchers:
                4 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Backbone Issue Sync

                  • Backbone Issue Sync is enabled for your project, but we do not have any synchronization info for this issue.

                    Git Integration