I create in my pc a simple SQLITE DB.
I add the files and use this code:
But doesn't work :BangHead:
Any idea? I'm using the android emulator, and next I want to update or query my db.
Tnx.
I add the files and use this code:
B4X:
Sub Activity_Create(FirstTime As Boolean)
'--------------------------------------------------
'Display layout
Log (File.ListFiles(File.DirAssets))
If FirstTime Then
SQL1.Initialize(File.DirAssets, "ice.sqlite", False)
End If
.
.
.
.
End Sub
But doesn't work :BangHead:
B4X:
>>>>>>>>>>>>>> AndroidRuntime START <<<<<<<<<<<<<<
CheckJNI is ON
--- registering native functions ---
Starting activity: Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10000000 cmp=net.fabrizioalberti.ice/.main }
Start proc net.fabrizioalberti.ice for activity net.fabrizioalberti.ice/.main: pid=721 uid=10037 gids={}
Shutting down VM
adbd disconnected
NOTE: attach of thread 'Binder Thread #3' failed
GC_EXPLICIT freed 237 objects / 9024 bytes in 343ms
GC_EXPLICIT freed 17 objects / 712 bytes in 143ms
GC_EXPLICIT freed 2 objects / 48 bytes in 185ms
** Activity (main) Create, isFirst = true **
(ArrayList) [emergy.png, ice.bal, ice.jpg, ice.sqlite, images, in-case-of-emergency-ice-icon.png, principale.bal, sounds, webkit]
sqlite returned: error code = 14, msg = cannot open file at source line 25467
sqlite3_open_v2("/data/data/net.fabrizioalberti.ice/files/ice.sqlite", &handle, 2, NULL) failed
main_activity_create (java line: 199)
android.database.sqlite.SQLiteException: unable to open database file
at android.database.sqlite.SQLiteDatabase.dbopen(Native Method)
at android.database.sqlite.SQLiteDatabase.<init>(SQLiteDatabase.java:1812)
at android.database.sqlite.SQLiteDatabase.openDatabase(SQLiteDatabase.java:817)
at anywheresoftware.b4a.sql.SQL.Initialize(SQL.java:29)
at net.fabrizioalberti.ice.main._activity_create(main.java:199)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:521)
at anywheresoftware.b4a.BA.raiseEvent2(BA.java:104)
at net.fabrizioalberti.ice.main.afterFirstLayout(main.java:84)
at net.fabrizioalberti.ice.main.access$100(main.java:16)
at net.fabrizioalberti.ice.main$WaitForLayout.run(main.java:72)
at android.os.Handler.handleCallback(Handler.java:587)
at android.os.Handler.dispatchMessage(Handler.java:92)
at android.os.Looper.loop(Looper.java:123)
at android.app.ActivityThread.main(ActivityThread.java:4627)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:521)
Any idea? I'm using the android emulator, and next I want to update or query my db.
Tnx.