Android Question Automatic backup of sqlite db

Dman

Active Member
Licensed User
Longtime User
My app has been out for a while and some of my users have broken/lost their devices and have had to have me help them through a reinstall to get their db info back on to their new devices. Right now I have the app set so that it zips the database and emails it to them with one click. I then used that backup to just drop their db into the files folder, compile and send them their backup. When they install it, it has all of their information ready to go. It works good doing it this way and I don't mind the few minutes it takes to do this for them.

The problem that I am running into though is that even though I have it set to back up with only one click, most guys don't do it and when they break their device, they do not have a current backup.

I am looking for a solution that will run the backup sub once a day or so. I can run it every time they start the app but most times the people might start their app 10 or 12 times a day so that wouldn't work. Is there something that I can do make it back up once a day whether the app is running or not? I tried searching but I really don't know what I am searching for.
 

MaFu

Well-Known Member
Licensed User
Longtime User
Save the current date on Activity_Pause. On Activity_Create compare the current date with the saved one and make the backup on difference. Then you have your backup once a day.
 
Upvote 0

Dman

Active Member
Licensed User
Longtime User
I have mine set to email the database backup to them. If they lose or break their device, they can send me their backup db and I just drop it into the install and send them a new install for their new device. It works very well and only takes me about 3 minutes.

I do have a question about this service. It seems to work well but when testing it, I input different times. For instance at 9:15 I put 9:30 so I wouldn't have to wait until the middle of the night to see if it worked. Once I got it working, I changed the time to 11:30. That worked fine but I'm still getting a backup at 9:30.

Is this normal? Do I need to do something to stop that one?
 
Upvote 0
Top