Starter.kvs.Initialize(Starter.myFolder, "Thumbnails")
For i=0 To db.media.Size-1
Starter.kvs.PutBitmap(id,bmp) 'id=@O01@,id=@O02@...id=@O129@
Next
I get:
B4X:
Starter.kvs.Initialize(Starter.myFolder, "Thumbnails")
Dim tempList As List
tempList = Starter.kvs.ListKeys
For i=0 To tempList.Size-1
Dim id As String=tempList.Get(i)
Log(id )
Next
'id=@O100@,@O101@,@O102@,@O103@,@O104@,@O105@
This does not correspond to the input order.
How can I sort kvs?
And the second question:
Two files appear in the Starter.myFolder folder - Thumbnails of 2 MB and Thumbnails-journal of 0B.
That is, the last file does not contain information. Is it necessary?
Two files appear in the Starter.myFolder folder - Thumbnails of 2 MB and Thumbnails-journal of 0B.
That is, the last file does not contain information. Is it necessary?
Thank you, but the output order of the values was not changed. If you use tempList.Sort(False), the output order will be reversed. In both cases, it does not match the input order of the data.
If you close after entering or outputting data, an error occurs:
Error occurred on line: 22 (KeyValueStore)
java.lang.IllegalStateException: attempt to re-open an already-closed object: SQLiteDatabase: /storage/emulated/0/Поколения/Thumbnails
at android.database.sqlite.SQLiteClosable.acquireReference(SQLiteClosable.java:58)
at android.database.sqlite.SQLiteDatabase.rawQueryWithFactory(SQLiteDatabase.java:1708)
at android.database.sqlite.SQLiteDatabase.rawQuery(SQLiteDatabase.java:1651)
at anywheresoftware.b4a.sql.SQL.ExecQuery2(SQL.java:223)
at sv.bystrovzorov.keyvaluestore._get(keyvaluestore.java:295)
at sv.bystrovzorov.keyvaluestore._getbitmap(keyvaluestore.java:196)
at sv.bystrovzorov.table._showrow(table.java:1697)
at sv.bystrovzorov.table._addrow(table.java:688)
at sv.bystrovzorov.function._filltablemedias(function.java:1118)
at sv.bystrovzorov.listmedia._setmedias(listmedia.java:565)
at sv.bystrovzorov.listmedia._activity_resume(listmedia.java:552)
at java.lang.reflect.Method.invoke(Native Method)
at anywheresoftware.b4a.shell.Shell.runMethod(Shell.java:732)
at anywheresoftware.b4a.shell.Shell.raiseEventImpl(Shell.java:348)
at anywheresoftware.b4a.shell.Shell.raiseEvent(Shell.java:255)
at java.lang.reflect.Method.invoke(Native Method)
at anywheresoftware.b4a.ShellBA.raiseEvent2(ShellBA.java:157)
at anywheresoftware.b4a.BA.raiseEvent(BA.java:201)
at sv.bystrovzorov.listmedia.afterFirstLayout(listmedia.java:111)
at sv.bystrovzorov.listmedia.access$000(listmedia.java:17)
at sv.bystrovzorov.listmedia$WaitForLayout.run(listmedia.java:83)
at android.os.Handler.handleCallback(Handler.java:942)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loopOnce(Looper.java:201)
at android.os.Looper.loop(Looper.java:288)
at android.app.ActivityThread.main(ActivityThread.java:7884)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:548)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:936)
If you do this when closing the application, the error does not occur, but Thumbnails-journal is not deleted
KeyValueStore is a b4xlib, a simple zip file.
Unzip it and edit the source code.
If you also want to know what changes to make, just pay me $10,000 and I'll do it right away
I was kidding, of course; $3000 should be enough for me
I think what you can add is a function that returns the rowids of the SQlite DB. It is not the optimal solution, because if you later change a key, the rowid will be the same as before, but it is a good alternative
Joke accepted
Thanks, this is not required. I just wanted to study the library in more detail. Unfortunately, its description is very sparse.
Thanks for participating in the discussion!
Joke accepted
Thanks, this is not required. I just wanted to study the library in more detail. Unfortunately, its description is very sparse.
Thanks for participating in the discussion!
MinimaListUtils Version : 1.07 A utility class to manipulate a simple List of Map to do basic CRUD. Treat it as some kind of a NoSQL for key-value pairs. It is suitable for small demo if you don't want to use SQL database. It depends on KeyValueStore library. It depends on RandomAccessFile...