-
public final class NameSpacea facade wraps custom root directory
-
-
Method Summary
Modifier and Type Method Description StringgetRootDir()MMKVmmkvWithID(String mmapID)Create an MMKV instance with an unique ID (in single-process mode). MMKVmmkvWithID(String mmapID, int mode)Create an MMKV instance in single-process or multi-process mode. MMKVmmkvWithID(String mmapID, int mode, long expectedCapacity)Create an MMKV instance in single-process or multi-process mode. MMKVmmkvWithID(String mmapID, int mode, @Nullable() String cryptKey)Create an MMKV instance in customize process mode, with an encryption key. MMKVmmkvWithID(String mmapID, int mode, @Nullable() String cryptKey, long expectedCapacity)Create an MMKV instance with customize settings all in one. booleanbackupOneToDirectory(String mmapID, String dstDir)backup one MMKV instance to dstDir booleanrestoreOneMMKVFromDirectory(String mmapID, String srcDir)restore one MMKV instance from srcDir booleanisFileValid(String mmapID)Check whether the MMKV file is valid or not.Note: Don't use this to check the existence of the instance, the result is undefined on nonexistent files. booleanremoveStorage(String mmapID)remove the storage of the MMKV, including the data file & meta file (. booleancheckExist(String mmapID)check existence of the MMKV file -
-
Method Detail
-
getRootDir
String getRootDir()
-
mmkvWithID
@NonNull() MMKV mmkvWithID(String mmapID)
Create an MMKV instance with an unique ID (in single-process mode).
- Parameters:
mmapID- The unique ID of the MMKV instance.
-
mmkvWithID
@NonNull() MMKV mmkvWithID(String mmapID, int mode)
Create an MMKV instance in single-process or multi-process mode.
- Parameters:
mmapID- The unique ID of the MMKV instance.mode- The process mode of the MMKV instance, defaults to SINGLE_PROCESS_MODE.
-
mmkvWithID
@NonNull() MMKV mmkvWithID(String mmapID, int mode, long expectedCapacity)
Create an MMKV instance in single-process or multi-process mode.
- Parameters:
mmapID- The unique ID of the MMKV instance.mode- The process mode of the MMKV instance, defaults to SINGLE_PROCESS_MODE.expectedCapacity- The file size you expected when opening or creating file
-
mmkvWithID
@NonNull() MMKV mmkvWithID(String mmapID, int mode, @Nullable() String cryptKey)
Create an MMKV instance in customize process mode, with an encryption key.
- Parameters:
mmapID- The unique ID of the MMKV instance.mode- The process mode of the MMKV instance, defaults to SINGLE_PROCESS_MODE.cryptKey- The encryption key of the MMKV instance (no more than 16 bytes).
-
mmkvWithID
@NonNull() MMKV mmkvWithID(String mmapID, int mode, @Nullable() String cryptKey, long expectedCapacity)
Create an MMKV instance with customize settings all in one.
- Parameters:
mmapID- The unique ID of the MMKV instance.mode- The process mode of the MMKV instance, defaults to SINGLE_PROCESS_MODE.cryptKey- The encryption key of the MMKV instance (no more than 16 bytes).expectedCapacity- The file size you expected when opening or creating file
-
backupOneToDirectory
boolean backupOneToDirectory(String mmapID, String dstDir)
backup one MMKV instance to dstDir
- Parameters:
mmapID- the MMKV ID to backupdstDir- the backup destination directory
-
restoreOneMMKVFromDirectory
boolean restoreOneMMKVFromDirectory(String mmapID, String srcDir)
restore one MMKV instance from srcDir
- Parameters:
mmapID- the MMKV ID to restoresrcDir- the restore source directory
-
isFileValid
boolean isFileValid(String mmapID)
Check whether the MMKV file is valid or not.Note: Don't use this to check the existence of the instance, the result is undefined on nonexistent files.
-
removeStorage
boolean removeStorage(String mmapID)
remove the storage of the MMKV, including the data file & meta file (.crc)Note: the existing instance (if any) will be closed & destroyed
- Parameters:
mmapID- The unique ID of the MMKV instance.
-
checkExist
boolean checkExist(String mmapID)
check existence of the MMKV file
- Parameters:
mmapID- The unique ID of the MMKV instance.
-
-
-
-