B4J Question How To Save KeyValueStore to Disk

cklester

Well-Known 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.
 

OliverA

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

LucaMs

Expert
Licensed User
Longtime 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:
Upvote 0

cklester

Well-Known Member
Licensed User

Ah, OK. Does this work if the file already exists? The data is saved between runs of the app?
 
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…