Android backup/restore: how to backup an internal database?

I have implemented a BackupAgentHelper using the provided FileBackupHelper to backup and restore the native database I have. This is the database you typically use along with ContentProviders and which resides in /data/data/yourpackage/databases/. One would think this is a common case. However the docs aren’t clear on what to do: http://developer.android.com/guide/topics/data/backup.html. There is no BackupHelper … Read more

PostgreSQL: improving pg_dump, pg_restore performance

When I began, I used pg_dump with the default plain format. I was unenlightened. Research revealed to me time and file size improvements with pg_dump -Fc | gzip -9 -c > dumpfile.gz. I was enlightened. When it came time to create the database anew, # create tablespace dbname location ‘/SAN/dbname’; # create database dbname tablespace … Read more

SQL-Server: Is there a SQL script that I can use to determine the progress of a SQL Server backup or restore process?

When I backup or restore a database using MS SQL Server Management Studio, I get a visual indication of how far the process has progressed, and thus how much longer I still need to wait for it to finish. If I kick off the backup or restore with a script, is there a way to … Read more

When exactly are onSaveInstanceState() and onRestoreInstanceState() called?

The following figure (from the official doc) describes the well-known lifecycle of an Android activity: On the other hand, when the activity is destroyed by the system (for example because memory needs to be reclaimed), the state of the activity is sometimes automatically saved and restored by means of the methods onSaveInstanceState() and onRestoreInstanceState(), as … Read more

What is the `git restore` command and what is the difference between `git restore` and `git reset`?

When I want to unstage a staged file, all of my Git tutorials show something like: $ git add * $ git status On branch master Changes to be committed: (use “git reset HEAD <file>…” to unstage) renamed: README.md -> README modified: CONTRIBUTING.md This hint tells us to use git reset for unstaging a staged … Read more