I can use DirInternal without RunTimePermissions (rtp) or SafeDefaultExternal folder with rtp without any problems with B4XPages. But, when I request permission and try to use it with DirRootExternal folder, it seems that problems pop up and the app crashes. To illustrate the problem, I have attached a complete project using a scaled back and stripped down B4XPages klaus SQLiteLight2 example to focus in the problem at hand.
I really need to have access to DirRootExternal because a few of my apps use it and I am sure thousands of forum developers use it because it is practical for many reasons cited by developers in the forum.
I hope many of you can download the project and see for yourselves. Perhaps, some of you could point where changes in my code need be made to make it work. To make B4XPages succeed we have to make it possible with rtp and external storage.
I even put the rtp request code in Starter service and in Main, but it did not help solve the crash. I also implemented Wait For to allow for permission to be granted first, but to no avail.
I really need to have access to DirRootExternal because a few of my apps use it and I am sure thousands of forum developers use it because it is practical for many reasons cited by developers in the forum.
I hope many of you can download the project and see for yourselves. Perhaps, some of you could point where changes in my code need be made to make it work. To make B4XPages succeed we have to make it possible with rtp and external storage.
I even put the rtp request code in Starter service and in Main, but it did not help solve the crash. I also implemented Wait For to allow for permission to be granted first, but to no avail.
B4X:
** Activity (main) Create, isFirst = true **
** Activity (main) Resume **
Error occurred on line: 66 (B4XMainPage)
java.lang.RuntimeException: Object should first be initialized.
at anywheresoftware.b4a.sql.SQL.checkNull(SQL.java:55)
at anywheresoftware.b4a.sql.SQL.ExecQuery(SQL.java:210)
at b4a.example.b4xmainpage._showtable(b4xmainpage.java:86)
at b4a.example.b4xmainpage._b4xpage_appear(b4xmainpage.java:55)
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 anywheresoftware.b4a.BA$2.run(BA.java:387)
at android.os.Handler.handleCallback(Handler.java:790)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:164)
at android.app.ActivityThread.main(ActivityThread.java:6523)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:438)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:857)