Android Question Use B4J kvs db in B4A

ilan

Expert
Licensed User
hi,

i am trying to load a keyvaluestore db i created in b4j to my b4a project but i am getting this error:

*** Service (starter) Create ***
** Service (starter) Start **
** Activity (main) Create, isFirst = true **
Class not found: b4a.example.customlistview, trying: www.sagital.buysmart.customlistview
Class not found: b4a.example.customlistview, trying: www.sagital.buysmart.customlistview
Error occurred on line: 40 (Main)
android.database.sqlite.SQLiteCantOpenDatabaseException: unknown error (code 1294): Could not open database
#################################################################
Error Code : 1294 (SQLITE_CANTOPEN_ENOENT)
Caused By : Specified directory or database file does not exist.
(unknown error (code 1294): Could not open database)
#################################################################
at android.database.sqlite.SQLiteConnection.nativeOpen(Native Method)
at android.database.sqlite.SQLiteConnection.open(SQLiteConnection.java:261)
at android.database.sqlite.SQLiteConnection.open(SQLiteConnection.java:204)
at android.database.sqlite.SQLiteConnectionPool.openConnectionLocked(SQLiteConnectionPool.java:633)
at android.database.sqlite.SQLiteConnectionPool.open(SQLiteConnectionPool.java:242)
at android.database.sqlite.SQLiteConnectionPool.open(SQLiteConnectionPool.java:214)
at android.database.sqlite.SQLiteDatabase.openInner(SQLiteDatabase.java:1184)
at android.database.sqlite.SQLiteDatabase.open(SQLiteDatabase.java:1139)
at android.database.sqlite.SQLiteDatabase.openDatabase(SQLiteDatabase.java:854)
at android.database.sqlite.SQLiteDatabase.openDatabase(SQLiteDatabase.java:829)
at anywheresoftware.b4a.sql.SQL.Initialize(SQL.java:44)
at b4a.example3.keyvaluestore._initialize(keyvaluestore.java:362)
at java.lang.reflect.Method.invoke(Native Method)
at anywheresoftware.b4a.shell.Shell.runVoidMethod(Shell.java:755)
at anywheresoftware.b4a.shell.Shell.raiseEventImpl(Shell.java:345)
at anywheresoftware.b4a.shell.Shell.raiseEvent(Shell.java:249)
at java.lang.reflect.Method.invoke(Native Method)
at anywheresoftware.b4a.ShellBA.raiseEvent2(ShellBA.java:139)
at www.sagital.buysmart.main.afterFirstLayout(main.java:104)
at www.sagital.buysmart.main.access$000(main.java:17)
at www.sagital.buysmart.main$WaitForLayout.run(main.java:82)
at android.os.Handler.handleCallback(Handler.java:789)
at android.os.Handler.dispatchMessage(Handler.java:98)
at android.os.Looper.loop(Looper.java:164)
at android.app.ActivityThread.main(ActivityThread.java:6938)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.Zygote$MethodAndArgsCaller.run(Zygote.java:327)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1374)

any suggestions?

thanx
 

ilan

Expert
Licensed User
Where are you storing the database file?

file.dirassets

:rolleyes: its a read only directory right? so this wont work?
 
Upvote 0

ilan

Expert
Licensed User
Copy it to File.DirInternal and then open it.

tumblr_m1tq0l7b3l1qieybw.gif


what makes me angry is that i remember i had such an issue in the past and i guess i solved it the same way you just said but why i dont remember it?! am i getting senile? :(
 
Upvote 0
Top