B4J Question How To Save KeyValueStore to Disk

cklester

Active Member
Licensed User
How do I save a KVS to disk? I searched "save keyvaluestore" and none of those threads actually explain how to save the KVS to disk. Unless I missed it... which is very possible. :D
 

OliverA

Expert
Licensed User
It does it for you. Nothing special needed
 

LucaMs

Expert
Licensed User
When you initialize it, you must pass the directory in which it will be saved.
B4X:
Dim kvs As KeyValueStore
kvs.Initialize(File.DirApp, "FileName") ' application folder (objects folder)
'or
kvs.Initialize(File.DirData, "FileName") ' windows user data folder
 
Last edited:

cklester

Active Member
Licensed User
When you initialize itm you must pass the directory in which it will be saved.
B4X:
Dim kvs As KeyValueStore
kvs.Initialize(File.DirApp, "FileName") ' application folder (objects folder)
'or
kvs.Initialize(File.DirData, "FileName") ' windows user data folder
Ah, OK. Does this work if the file already exists? The data is saved between runs of the app?
 
Top