public class TxStandardCache extends ObjectThe standard cache configuration that the TxNative SDK is initialized with, if no other cache is provided.
TxStandardCache is backed by a
TxMemoryCachewhich is initialized with existing translation files from the app's Assets folder and the app's cache directory in this specific order. When the cache is updated (when new translations become available after calling
TxNative.fetchTranslations(String)), TxStandardCache stores the new translations in the app's cache directory. The in-memory translations are not affected by the update though. A new instance of TxStandardCache has to be created (after an app restart by default) to read the new translations saved in the app's cache directory
public static TxCache getCache(@NonNull Context context, @Nullable Integer updatePolicy, @Nullable File cachedTranslationsDirectory)Creates a cache with the configuration explained in
context- The app's context.
updatePolicy- The update policy to be used when initializing the internal memory cache with the stored contents from disk. If set to
cachedTranslationsDirectory- The directory where the cache will store new translations when available and read translations from when initialized. If set to
nullit uses a "txnative" folder in the app's internal cache directory.
- A TxCache instance.