Details
-
Type:
New Feature
-
Status: Closed
-
Priority:
Low
-
Resolution: Fixed
-
Affects Version/s: None
-
Fix Version/s: Release 9.3.0
-
Component/s: Android
-
Labels:
-
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'); |
}
|