Backup sqlite on Android

The place to discuss anything and everything about running your LiveCode on Android

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
SChamblee
Posts: 19
Joined: Wed Jun 24, 2015 7:45 pm

Backup sqlite on Android

Post by SChamblee » Thu Sep 24, 2015 3:53 pm

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.

Simon
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 3901
Joined: Sat Mar 24, 2007 2:54 am

Re: Backup sqlite on Android

Post by Simon » Thu Sep 24, 2015 10:01 pm

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
I used to be a newbie but then I learned how to spell teh correctly and now I'm a noob!

SChamblee
Posts: 19
Joined: Wed Jun 24, 2015 7:45 pm

Re: Backup sqlite on Android

Post by SChamblee » Fri Sep 25, 2015 12:42 am

Thanks I will have to see if I can get that working.

MaxV
Posts: 1580
Joined: Tue May 28, 2013 2:20 pm
Contact:

Re: Backup sqlite on Android

Post by MaxV » Fri Sep 25, 2015 3:15 pm

Read this page: http://livecode.wikia.com/wiki/Saving_files_on_Android
In order to backup your data just copy specialFolderPath("Documents") content.
Livecode Wiki: http://livecode.wikia.com
My blog: https://livecode-blogger.blogspot.com
To post code use this: http://tinyurl.com/ogp6d5w

SChamblee
Posts: 19
Joined: Wed Jun 24, 2015 7:45 pm

Re: Backup sqlite on Android

Post by SChamblee » Fri Sep 25, 2015 8:55 pm

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.

SChamblee
Posts: 19
Joined: Wed Jun 24, 2015 7:45 pm

Re: Backup sqlite on Android

Post by SChamblee » Fri Sep 25, 2015 11:30 pm

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

Post Reply