Hello, this is the problem:
Msgbox("ok","")
End If
If File.Exists (File.DirDefaultExternal, "db1.db") = False Then
-----here ok, the file is NOT found----
Msgbox("db1.db","non esiste")
-----here the copy error, the file is not found! ----
File.Copy(File.DirAssets, "db1.db", File.DirDefaultExternal, "db1.db")
End If
Why?
Error occurred on line: 54 (Main)
java.io.FileNotFoundException: /storage/emulated/0/Android/data/b4a.example/files/db1.db (No such file or directory)
at java.io.FileOutputStream.open(Native Method)
at java.io.FileOutputStream.<init>(FileOutputStream.java:221)
at anywheresoftware.b4a.objects.streams.File.OpenOutput(File.java:373)
at anywheresoftware.b4a.objects.streams.File.Copy(File.java:339)
at b4a.example.main._activity_create(main.java:428)
at java.lang.reflect.Method.invoke(Native Method)
at anywheresoftware.b4a.shell.Shell.runMethod(Shell.java:710)
at anywheresoftware.b4a.shell.Shell.raiseEventImpl(Shell.java:342)
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 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:836)
at android.os.Handler.dispatchMessage(Handler.java:103)
at android.os.Looper.loop(Looper.java:203)
at android.app.ActivityThread.main(ActivityThread.java:6251)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1063)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:924)
-----here ok, the file is found----
If File.Exists (File.DirAssets, "db1.db") = True ThenMsgbox("ok","")
End If
If File.Exists (File.DirDefaultExternal, "db1.db") = False Then
-----here ok, the file is NOT found----
Msgbox("db1.db","non esiste")
-----here the copy error, the file is not found! ----
File.Copy(File.DirAssets, "db1.db", File.DirDefaultExternal, "db1.db")
End If
Why?
Error occurred on line: 54 (Main)
java.io.FileNotFoundException: /storage/emulated/0/Android/data/b4a.example/files/db1.db (No such file or directory)
at java.io.FileOutputStream.open(Native Method)
at java.io.FileOutputStream.<init>(FileOutputStream.java:221)
at anywheresoftware.b4a.objects.streams.File.OpenOutput(File.java:373)
at anywheresoftware.b4a.objects.streams.File.Copy(File.java:339)
at b4a.example.main._activity_create(main.java:428)
at java.lang.reflect.Method.invoke(Native Method)
at anywheresoftware.b4a.shell.Shell.runMethod(Shell.java:710)
at anywheresoftware.b4a.shell.Shell.raiseEventImpl(Shell.java:342)
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 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:836)
at android.os.Handler.dispatchMessage(Handler.java:103)
at android.os.Looper.loop(Looper.java:203)
at android.app.ActivityThread.main(ActivityThread.java:6251)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1063)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:924)