Sub Process_Globals
Public kvs As KeyValueStore
end sub
Sub btn_Clicked
Private rec As List
rec.Initialize
rec.AddAll(Array As String("Account2","my account2","12345"))
kvs.PutEncrypted( "Account2",rec,PASSWORD)
rec.Initialize
rec.AddAll(Array As String("Account1","my account1,"12345"))
kvs.PutEncrypted( "Account1",rec,PASSWORD)
End Sub
When I list keyvalueStore
B4X:
Sub List
For i = 0 To kvs.ListKeys.Size - 1
LogColor(kvs.ListKeys.Get(i),Colors.Yellow)
Next
End Sub
The log result in Jellybean shows keys order by input sequence
Account2
Account1
but on Pie, the order is alphabetically
Account1
Account2
Is there a way to show keys order by input sequence in every OS ?
'creates the main table (if it does not exist)
Private Sub CreateTable
sql1.ExecNonQuery("CREATE TABLE IF NOT EXISTS main(key TEXT PRIMARY KEY, value NONE)")
End Sub
to:
B4X:
'creates the main table (if it does not exist)
Private Sub CreateTable
sql1.ExecNonQuery("CREATE TABLE IF NOT EXISTS main(key TEXT, value NONE)")
End Sub
Deselect the library, of course, and delete the previous kvs file, if it exists.
Unfortunately I have to abandon this keyvalue store.
I just realize that keyvalue only encrypt value not the key. This is not enough for my need.
Perhaps, I will looking for sqlcipher or randomaccessfile to encrypt all data.