B4J Library KeyValueStore class

Erel

Administrator
Staff member
Licensed User
This is a port of this class: http://www.basic4ppc.com/android/forum/threads/keyvaluestore-class-simple-and-efficient-key-value-data-store.26317/

Note that you need to add the following attribute to your project:
B4X:
#AdditionalJar: sqlite-jdbc-3.7.2
If you want to use PutEncryptedObject / GetEncryptedObject then you need to download BouncyCastle and add another #AdditionalJar: http://www.basic4ppc.com/android/forum/threads/share-encrypted-data-with-b4a.35482/#content

KeyValueStore v2 is available here: https://www.b4x.com/android/forum/threads/b4x-keyvaluestore-2-simple-powerful-local-datastore.63633/
 

Attachments

Last edited:

Locutus

Member
Licensed User
This is a port of this class: http://www.basic4ppc.com/android/forum/threads/keyvaluestore-class-simple-and-efficient-key-value-data-store.26317/

If you want to use PutEncryptedObject / GetEncryptedObject then you need to download BouncyCastle and add another #AdditionalJar: http://www.basic4ppc.com/android/forum/threads/share-encrypted-data-with-b4a.35482/#content
Even if you don't want to use encryption you will still need to download the jRandomAccessFile.zip from the above BouncyCastle link and install it over the existing libraries for this class to work. Otherwise it fails on compile.
 

Erel

Administrator
Staff member
Licensed User
The latest version of jRandomAccessFile is included in B4J v1.06.
 

Theera

Well-Known Member
Licensed User
Hi all,
If you want to use PutEncryptedObject / GetEncryptedObject then you need to download BouncyCastle and add another #AdditionalJar: http://www.basic4ppc.com/android/forum/threads/share-encrypted-data-with-b4a.35482/#content
In the post#1 ,I copy bcprov-jdk15on-150.jar into additional library folder and then add #AdditionalJar: bcprov-jdk15on-150 at Project Attributes of the example in the post#1,but I've never seen what is different. Please someone help explain to me clearly. What's something be wrong?
 

bluedude

Well-Known Member
Licensed User
I'm trying to do below with KeyValue store class but it does not work:

Type itemRecord (ID As String, Description As String )

Dim newRecord As itemRecord
Dim recordID As String

newRecord.Initialize
newRecord.ID ="test"
recordID = "record:" & newRecord.ID
newRecord.Description ="This is a test"
kvs.PutObject(recordID,newRecord)

Getting an error it cannot store the object.
 

LucaMs

Expert
Licensed User
What error you get?

Your code do not contains errors (if this class works like in B4A, as I presume)
 
Top