Hello again, I am back with an error I though i solved it but nope.
I am developing with the latest B4A 11.20. My SDKs are checked and OK.
The SQlite Database Version 3 is checked an can be open by a Databasemangement App.
My Problem is that I am not able to open the Sqlite Database Vers. 3. I have this Problem since updating on 11.20 not before!
1. in My Manifest I added: AddPermission(android.permission.WRITE_EXTERNAL_STORAGE)
2. in Starter.Service_Create I added
3. I connect my Huawei p20pro with Android 8 via B4xBridge.
4. I checked case sensivity of the database file name.
5. I run the code in Debug and in Release mode.
6. I got the error message
7. I checked the directory on the phone and I see there is no database file copied!
8. Instead of DBUtils I tried is with file.copy but its running into the same problem.
I am at he end of my knowledge what is wrong and what is the solution. Can anyone help me please. Thank you.
I am developing with the latest B4A 11.20. My SDKs are checked and OK.
The SQlite Database Version 3 is checked an can be open by a Databasemangement App.
My Problem is that I am not able to open the Sqlite Database Vers. 3. I have this Problem since updating on 11.20 not before!
1. in My Manifest I added: AddPermission(android.permission.WRITE_EXTERNAL_STORAGE)
B4X:
'This code will be applied to the manifest file during compilation.
'You do not need to modify it in most cases.
'See this link for for more information: https://www.b4x.com/forum/showthread.php?p=78136
AddManifestText(
<uses-sdk android:minSdkVersion="20" android:targetSdkVersion="29"/>
<supports-screens android:largeScreens="true"
android:normalScreens="true"
android:smallScreens="true"
android:anyDensity="true"/>)
SetApplicationAttribute(android:icon, "@drawable/icon")
SetApplicationAttribute(android:label, "$LABEL$")
CreateResourceFromFile(Macro, Themes.LightTheme)
'End of default text.
AddPermission(android.permission.RECORD_AUDIO)
AddPermission(android.permission.INTERNET)
AddPermission(android.permission.ACCESS_NOTIFICATION_POLICY)
AddPermission(android.permission.WRITE_EXTERNAL_STORAGE)
B4X:
DBDir=DBUtils.CopyDBFromAssets("FDM.db")
SQLite.Initialize(DBUtils.GetDBFolder,"FDM.db",False)
4. I checked case sensivity of the database file name.
5. I run the code in Debug and in Release mode.
6. I got the error message
B4X:
Error occurred on line: 42 (DBUtils)
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:225)
at android.database.sqlite.SQLiteConnection.open(SQLiteConnection.java:209)
at android.database.sqlite.SQLiteConnectionPool.openConnectionLocked(SQLiteConnectionPool.java:541)
at android.database.sqlite.SQLiteConnectionPool.open(SQLiteConnectionPool.java:209)
at android.database.sqlite.SQLiteConnectionPool.open(SQLiteConnectionPool.java:198)
at android.database.sqlite.SQLiteDatabase.openInner(SQLiteDatabase.java:936)
at android.database.sqlite.SQLiteDatabase.open(SQLiteDatabase.java:923)
at android.database.sqlite.SQLiteDatabase.openDatabase(SQLiteDatabase.java:821)
at android.database.sqlite.SQLiteDatabase.openDatabase(SQLiteDatabase.java:770)
at anywheresoftware.b4a.sql.SQL.Initialize(SQL.java:44)
at java.lang.reflect.Method.invoke(Native Method)
at anywheresoftware.b4a.shell.Shell.runVoidMethod(Shell.java:777)
at anywheresoftware.b4a.shell.Shell.raiseEventImpl(Shell.java:354)
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 anywheresoftware.b4a.BA.raiseEvent(BA.java:193)
at anywheresoftware.b4a.shell.DebugResumableSub$RemoteResumableSub.resume(DebugResumableSub.java:22)
at anywheresoftware.b4a.keywords.Common$13.run(Common.java:1714)
at android.os.Handler.handleCallback(Handler.java:809)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:166)
at android.app.ActivityThread.main(ActivityThread.java:7367)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:469)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:963)
7. I checked the directory on the phone and I see there is no database file copied!
8. Instead of DBUtils I tried is with file.copy but its running into the same problem.
I am at he end of my knowledge what is wrong and what is the solution. Can anyone help me please. Thank you.