Description: A class to manage the backup of SQLite files.
It allows you to manage backup SQLite database files, set the maximum number of backups to keep, create backups at any time and with any name (with a field for an additional note) or set an automatic backup: daily, weekly or monthly.
Depends on: KeyValueStore (which in turn depends on RandomAccessFile).
* Note: you should declare (and initialize) a global variable named KVStore as KeyValueStore in the Process_Globals of the Main activity (or elsewhere, but in this case, you should modify the references in these sub routines: Initialize, LoadBackupMap and SaveBackupMap).
Main methods:
- CreateBackup(BackupName As String, Note As String) As Boolean
Creates a db backup.
- RestoreFromBackup(BackupName As String) As Boolean
Restores the db from a backup.
- DeleteBackup(BackupName As String) As Boolean
Deletes a backup file.
- LoadBackupMap *
Gets the backup map from the KeyValueStore.
- SaveBackupMap *
Puts the backup map in to the KeyValueStore.
- FillListView(lvw As ListView)
Fills the listview passed as a parameter with the descriptive data of the backup files
- ReadSettings
Reads: max number of backups, Automatic state and period
- SaveSettings
Saves: max number of backups, Automatic state and period
Properties:
- MaxBackups
Sets/Gets max number of backups.
- BkpInfos
Gets a map as follows:
Backup names are the Keys;
Objects of type typBkpInfo are the values.
- Auto
Sets/Gets the periodically automated setting ON/OFF.
- AutoPeriod
Sets/Gets the periodically automated period.
Period can be: AUTO_DAILY, AUTO_WEEKLY, AUTO_MONTHY
Type:
- typBkpInfo(Created As Long, Note As String)
Created: the creation date;
Note: a description for the backup.
[I have not tested the attached sample completely]
Tags: Backup
It allows you to manage backup SQLite database files, set the maximum number of backups to keep, create backups at any time and with any name (with a field for an additional note) or set an automatic backup: daily, weekly or monthly.
Depends on: KeyValueStore (which in turn depends on RandomAccessFile).
* Note: you should declare (and initialize) a global variable named KVStore as KeyValueStore in the Process_Globals of the Main activity (or elsewhere, but in this case, you should modify the references in these sub routines: Initialize, LoadBackupMap and SaveBackupMap).
Main methods:
- CreateBackup(BackupName As String, Note As String) As Boolean
Creates a db backup.
- RestoreFromBackup(BackupName As String) As Boolean
Restores the db from a backup.
- DeleteBackup(BackupName As String) As Boolean
Deletes a backup file.
- LoadBackupMap *
Gets the backup map from the KeyValueStore.
- SaveBackupMap *
Puts the backup map in to the KeyValueStore.
- FillListView(lvw As ListView)
Fills the listview passed as a parameter with the descriptive data of the backup files
- ReadSettings
Reads: max number of backups, Automatic state and period
- SaveSettings
Saves: max number of backups, Automatic state and period
Properties:
- MaxBackups
Sets/Gets max number of backups.
- BkpInfos
Gets a map as follows:
Backup names are the Keys;
Objects of type typBkpInfo are the values.
- Auto
Sets/Gets the periodically automated setting ON/OFF.
- AutoPeriod
Sets/Gets the periodically automated period.
Period can be: AUTO_DAILY, AUTO_WEEKLY, AUTO_MONTHY
Type:
- typBkpInfo(Created As Long, Note As String)
Created: the creation date;
Note: a description for the backup.
[I have not tested the attached sample completely]
Tags: Backup
Attachments
Last edited: