Hi all,
I believe it might be my misunderstanding of the library but i will post my question.
I am trying to store a list using the KeyValueStore to avoid having to get it from the server numerous times.
Its working. The first time it will get the list from the server, and the other times will get it locally.
However once i quit the app, its as if nothing was stored, i can't get the list back... Help?
Here's parts of my "setting the list" code...
Here's when i check BEFORE my http call
Would it be because of my File.dirDocuments ?
Thanks.
Y.
I believe it might be my misunderstanding of the library but i will post my question.
I am trying to store a list using the KeyValueStore to avoid having to get it from the server numerous times.
Its working. The first time it will get the list from the server, and the other times will get it locally.
However once i quit the app, its as if nothing was stored, i can't get the list back... Help?
Here's parts of my "setting the list" code...
B4X:
'Setting the list as "root" from my http call if "OptoLensListLocal" was null
Dim parser As JSONParser
parser.Initialize(result)
Dim root As List = parser.NextArray
kvs.Initialize(File.dirdocuments,"OptoLensListLocal")
If(kvs.Get("OptoLensListLocal")=Null)Then
kvs.PutEncrypted("OptoLensListLocal",root,"x123y")
End If
Here's when i check BEFORE my http call
B4X:
If(kvs.GetEncrypted("OptoLensListLocal","x123y")<>Null)Then
'Getting localized list
else
'Fetch from server
end if
Would it be because of my File.dirDocuments ?
Thanks.
Y.