Android Question Database backup

doogal

Member
Licensed User
Longtime User
I have an app that uses an sql database and this app works as it should, but now I want to add a backup feature. My wife recently had an update on her phone and it totally wiped her sd card, she lost everything. I don't want her to lose this information in the future. So I want to implement a backup feature to say her Dropbox folder, this would save her from having to type in all the information again. So my question is this: How do I implement this? Since I have never messed with RDC or anything of the sort. I have no idea where to begin.

I have searched the forums for this and its still confusing. I'm just not sure where to begin other than a button that says "backup to dropbox"
 

doogal

Member
Licensed User
Longtime User
Thanks for the quick response. I will take a look at this, but its just going to save to the sd card. I need a remote location as my wife's card was completely erased when she did the update.
 
Upvote 0

Dman

Active Member
Licensed User
Longtime User
I zip my db into a folder and email it to myself as an attachment just by pressing a backup button. That way if something happens, I just unzip the backup and compile using that instead of the original db and everything is just as it was at the last backup.
 
Upvote 0

doogal

Member
Licensed User
Longtime User
Hi all,

I found the DropboxSync library and I believe its the solution to my problem. However, I can't seem to sync/update the file on Dropbox. I can upload the file but it doesn't overwrite the file currently on Dropbox. I need to sync it, rename it or use dates. I'm just not sure. I would like to know how I can use the sync option. I tried manager.sync and it worked one time and then stopped. I hope someone can help.

Thank you,
Douglas
 
Upvote 0

doogal

Member
Licensed User
Longtime User
Erel, Thanks for the reply. I have checked and it is going to the correct folder. I have deleted it manually from DropBox and tried again. The application uploads and syncs only once after that it will not do it again.
 
Upvote 0

doogal

Member
Licensed User
Longtime User
I can click the upload button and watch it post to my Dropbox folder and it on my computer it says test.txt has been added and test.txt has been updated. This only happens once, after that when I click the upload button I see no activity on DropBox. I am using a separate folder in Apps so it shows like /Apps/XXXXX and the tutorial says I am supposed to treat this as root, so I use it like this:
B4X:
manager.UploadFile(File.DirDefaultExternal, "test.txt", "/", "test.txt")
and to sync I just use the following:
B4X:
manager.Sync
 
Upvote 0

doogal

Member
Licensed User
Longtime User
Thank you Erel I took another look and it does work. I was trying to up upload the same file and expecting to see a change, so I made an entry and re-uploaded the file and it worked. Thank you so much for this library, it really going to help with my app.

Thank you,
Douglas
 
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…