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

Android: Add Ti.Filesystem.externalCacheDirectory support

    Details

    • Story Points:
      1
    • Sprint:
      2020 Sprint 23

      Description

      Summary:
      On Android and iOS, we offer an applicationCacheDirectory property used to write temporary files to internal storage.

      Android supports a sandboxed cache directory for the app on external storage, which typically provides more storage space. Unlike externalStorageDirectory, the external cache directory is not automatically backed-up by the system. This makes it a good location for LARGE temporary files.

      We should expose this Android-only feature via the following property.
      Ti.Filesystem.externalCacheDirectory

      Note 1:
      You do NOT need the following permissions to read/write to the external cache folder.

      • READ_EXTERNAL_STORAGE
      • WRITE_EXTERNAL_STORAGE

      Note 2:
      You do NOT need to use the following APIs before reading/writing to this folder.

      Note 3:
      You do need to check the isExternalStoragePresent() method to see if external storage is mounted before using this folder.

      Example:

      if (Ti.Filesystem.isExternalStoragePresent()) {
      	const myFile = Ti.Filesystem.getFile(Ti.Filesystem.externalCacheDirectory, 'MyFile.txt');
      	myFile.write('Hello World');
      }
      

        Attachments

          Activity

            People

            • Assignee:
              jquick Joshua Quick
              Reporter:
              jquick Joshua Quick
              Reviewer:
              Gary Mathews
              Tester:
              Lokesh Choudhary
            • Watchers:
              2 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