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:
- Build and run the below code on Android.
- In the log, notice nativePath is immediately under the cache folder.
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.