I have an app that uses a SQLITE database, and i just want allow the user to back it up somewhere.
I would love to put it on the root of the SD card, however, whatever i try doesnt work. it only allows me to copy to the sandboxed area (IE: sdcard/android/your app id/files etc)
The problem with this, is if the customer deletes and re-installs the app, deleting the app removes that directory and backups are lost.
I am SO open to any idea on how to handle this. Im sure there are others out there that have to backup.
frustrating because the app is all finished except for this.
Hi, I want a file copy from internal device memory, e.g. xxxinternalxx/DCIM/test.jpg to the SD card, e.g. xxexternalxx/TEST/test.jpg (file-type is not specified, can be ".txt", ".jpg", ".wma" or anything else). The original file should be deleted (move the file is also ok). I've already tried...
where im stuck is trying to blindly create a directory.
what im trying to do is on the startup, create a directory on the root of the SD (Appname, then Appname/Backups)
but it keeps crashing on the "CreateNewDirectory" function with a null pointer.
I can get it if i show the filedialog, but like i said, i want it hidden.
Error occurred on line: 70 (ExternalStorage)
java.lang.NullPointerException: Attempt to invoke virtual method 'java.lang.Object anywheresoftware.b4j.object.JavaObject.RunMethod(java.lang.String, java.lang.Object[])' on a null object reference
at com.PrintChecksPro.PCP.externalstorage._createnewdir(externalstorage.java:190)
at com.PrintChecksPro.PCP.main2._showfirst(main2.java:1334)
at com.PrintChecksPro.PCP.main2._activity_create(main2.java:660)
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 com.PrintChecksPro.PCP.main2.afterFirstLayout(main2.java:104)
at com.PrintChecksPro.PCP.main2.access$000(main2.java:17)
at com.PrintChecksPro.PCP.main2$WaitForLayout.run(main2.java:82)
at android.os.Handler.handleCallback(Handler.java:751)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:154)
at android.app.ActivityThread.main(ActivityThread.java:6188)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:911)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:801)
** Activity (main2) Resume **
It is MANDATORY to let the user choose the root path ONCE (you can save the path once the user selected the rootpath for further use).
It can not be prevented...
Also note that the user may select any subfolder of the SD Card instead of the ROOT Folder.
In this case you´ll only get access to the Selected path (and everything in it (sub-folder-structure)).