B4J Library KeyValueStore class

Discussion in 'B4J Libraries & Classes' started by Erel, Jan 14, 2014.

  1. Erel

    Erel Administrator Staff Member Licensed User

    This is a port of this class: http://www.basic4ppc.com/android/fo...ple-and-efficient-key-value-data-store.26317/

    Note that you need to add the following attribute to your project:
    Code:
    #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/
     

    Attached Files:

    Last edited: Feb 17, 2016
    Peter Simpson and Theera like this.
  2. Locutus

    Locutus Member Licensed User

    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.
     
  3. Erel

    Erel Administrator Staff Member Licensed User

    The latest version of jRandomAccessFile is included in B4J v1.06.
     
  4. Locutus

    Locutus Member Licensed User

    Aah, I am still on V1.00. Didn't know there was an update.
     
  5. Theera

    Theera Well-Known Member Licensed User

    Hi all,
    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?
     
  6. Erel

    Erel Administrator Staff Member Licensed User

    The encryption methods will fail without this jar.
     
  7. bluedude

    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.
     
  8. LucaMs

    LucaMs Expert Licensed User

    What error you get?

    Your code do not contains errors (if this class works like in B4A, as I presume)
     
Loading...
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice