Page 1 of 1
Backup sqlite on Android
Posted: Thu Sep 24, 2015 3:53 pm
by SChamblee
I'm fairly new to LC and I have not found a way to backup SQLite from the device. It would also be nice if Google cloud would backup the database with the application. Had user get a new phone and when they setup their new phone the app was installed without moving their data. Kind of useless to build an app when the data can't be backed up / moved.
Any recommendations would be much appreciated.
Re: Backup sqlite on Android
Posted: Thu Sep 24, 2015 10:01 pm
by Simon
Hi SChamblee,
LiveCode has got ftp working on mobile so you can upload via that.
Here are other methods;
http://forums.livecode.com/viewtopic.php?f=8&t=19144
Simon
Re: Backup sqlite on Android
Posted: Fri Sep 25, 2015 12:42 am
by SChamblee
Thanks I will have to see if I can get that working.
Re: Backup sqlite on Android
Posted: Fri Sep 25, 2015 3:15 pm
by MaxV
Read this page:
http://livecode.wikia.com/wiki/Saving_files_on_Android
In order to backup your data just copy specialFolderPath("Documents") content.
Re: Backup sqlite on Android
Posted: Fri Sep 25, 2015 8:55 pm
by SChamblee
Thanks Max
Looks promising. Backup from the Document folder to the sdcard will be real nice, then the user could move the data easily to their computer.
Re: Backup sqlite on Android
Posted: Fri Sep 25, 2015 11:30 pm
by SChamblee
With the information that Max provided and information from another post on this forum I got the solution.
put URL ("binfile:" & specialFolderPath("Documents") & "/myfile.sqlite") into URL ("binfile:" & "mnt/sdcard/myfile.sqlite")
This copy the file to the internal memory, I haven't tested put I believe you add the number 2 to the sdcard to write to the external sdcard.
Just incase anyone else needs to copy files