KVS seems to be exactly what I need. In another language, all my apps use a "dictionary" which supports all settings through key value pairs.
I am trying to implement it in a small test project.
I get the error below. Apparently SQL complains that it cannot open it's database. Please forget my ignorance, I was under the impression that initialize was all that was needed. What must I do to create that SQL file ? Or is it something I left out ?
Any help will be appreciated.
TIA.
--------- beginning of system
--------- beginning of main
*** Service (starter) Create ***
** Service (starter) Start **
** Activity (main) Create, isFirst = true **
Error occurred on line: 37 (Main)
android.database.sqlite.SQLiteCantOpenDatabaseException: unknown error (Sqlite code 14): Could not open database, (OS error - 2:No such file or directory)
at android.database.sqlite.SQLiteConnection.nativeOpen(Native Method)
at android.database.sqlite.SQLiteConnection.open(SQLiteConnection.java:223)
at android.database.sqlite.SQLiteConnection.open(SQLiteConnection.java:207)
at android.database.sqlite.SQLiteConnectionPool.openConnectionLocked(SQLiteConnectionPool.java:511)
at android.database.sqlite.SQLiteConnectionPool.open(SQLiteConnectionPool.java:194)
at android.database.sqlite.SQLiteConnectionPool.open(SQLiteConnectionPool.java:183)
at android.database.sqlite.SQLiteDatabase.openInner(SQLiteDatabase.java:880)
at android.database.sqlite.SQLiteDatabase.open(SQLiteDatabase.java:864)
at android.database.sqlite.SQLiteDatabase.openDatabase(SQLiteDatabase.java:767)
at android.database.sqlite.SQLiteDatabase.openDatabase(SQLiteDatabase.java:742)
at anywheresoftware.b4a.sql.SQL.Initialize(SQL.java:44)
at b4a.example3.keyvaluestore._initialize(keyvaluestore.java:362)
at b4a.example.main._activity_create(main.java:394)
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:351)
at anywheresoftware.b4a.shell.Shell.raiseEvent(Shell.java:255)
at java.lang.reflect.Method.invoke(Native Method)
at anywheresoftware.b4a.ShellBA.raiseEvent2(ShellBA.java:144)
at b4a.example.main.afterFirstLayout(main.java:104)
at b4a.example.main.access$000(main.java:17)
at b4a.example.main$WaitForLayout.run(main.java:82)
at android.os.Handler.handleCallback(Handler.java:808)
at android.os.Handler.dispatchMessage(Handler.java:101)
at android.os.Looper.loop(Looper.java:166)
at android.app.ActivityThread.main(ActivityThread.java:7529)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.Zygote$MethodAndArgsCaller.run(Zygote.java:245)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:921)
** Activity (main) Resume **
I am trying to implement it in a small test project.
B4X:
Sub Globals
'These global variables will be redeclared each time the activity is created.
'These variables can only be accessed from this module.
Dim Diko As KeyValueStore
End Sub
B4X:
Sub Activity_Create(FirstTime As Boolean)
'Do not forget to load the layout file created with the visual designer. For example:
'Activity.LoadLayout("Layout1")
Activity.LoadLayout("Main")
'Initialize Diko
If FirstTime Then
Diko.Initialize(File.DirDefaultExternal, "datastore")
End If
I get the error below. Apparently SQL complains that it cannot open it's database. Please forget my ignorance, I was under the impression that initialize was all that was needed. What must I do to create that SQL file ? Or is it something I left out ?
Any help will be appreciated.
TIA.
--------- beginning of system
--------- beginning of main
*** Service (starter) Create ***
** Service (starter) Start **
** Activity (main) Create, isFirst = true **
Error occurred on line: 37 (Main)
android.database.sqlite.SQLiteCantOpenDatabaseException: unknown error (Sqlite code 14): Could not open database, (OS error - 2:No such file or directory)
at android.database.sqlite.SQLiteConnection.nativeOpen(Native Method)
at android.database.sqlite.SQLiteConnection.open(SQLiteConnection.java:223)
at android.database.sqlite.SQLiteConnection.open(SQLiteConnection.java:207)
at android.database.sqlite.SQLiteConnectionPool.openConnectionLocked(SQLiteConnectionPool.java:511)
at android.database.sqlite.SQLiteConnectionPool.open(SQLiteConnectionPool.java:194)
at android.database.sqlite.SQLiteConnectionPool.open(SQLiteConnectionPool.java:183)
at android.database.sqlite.SQLiteDatabase.openInner(SQLiteDatabase.java:880)
at android.database.sqlite.SQLiteDatabase.open(SQLiteDatabase.java:864)
at android.database.sqlite.SQLiteDatabase.openDatabase(SQLiteDatabase.java:767)
at android.database.sqlite.SQLiteDatabase.openDatabase(SQLiteDatabase.java:742)
at anywheresoftware.b4a.sql.SQL.Initialize(SQL.java:44)
at b4a.example3.keyvaluestore._initialize(keyvaluestore.java:362)
at b4a.example.main._activity_create(main.java:394)
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:351)
at anywheresoftware.b4a.shell.Shell.raiseEvent(Shell.java:255)
at java.lang.reflect.Method.invoke(Native Method)
at anywheresoftware.b4a.ShellBA.raiseEvent2(ShellBA.java:144)
at b4a.example.main.afterFirstLayout(main.java:104)
at b4a.example.main.access$000(main.java:17)
at b4a.example.main$WaitForLayout.run(main.java:82)
at android.os.Handler.handleCallback(Handler.java:808)
at android.os.Handler.dispatchMessage(Handler.java:101)
at android.os.Looper.loop(Looper.java:166)
at android.app.ActivityThread.main(ActivityThread.java:7529)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.Zygote$MethodAndArgsCaller.run(Zygote.java:245)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:921)
** Activity (main) Resume **