3

I'm creating an Android app that has a SQLite database (nodes.db) and a folder with .png images (which relative filepaths are stored at the db).

In order to enable exporting/importing this db together with images (one .db and many .pngs in a single file), I'm thinking about creating a .tar-like file.

  • How is it done? (packing / unpacking .tar files programatically on Android)
  • Are there any better solutions? (other than creating the .tar file)
horta
  • 2,292
  • 2
  • 14
  • 16

1 Answers1

2

You can also consider http://developer.android.com/google/backup/index.html Android Backup Service for your purpose.

[Edit]Since you don't want an online backup, you can have a look at the solution proposed here : https://stackoverflow.com/a/12490002/1234007

You can take a dump of your SQLite database this way and then all you have to do is create a tar file, for that there is a very good library out there https://code.google.com/p/jtar/.

If you want to make the backup you made encrypted and password protected, it may be better to use zip as the backup file https://code.google.com/p/winzipaes/ is there for rescue.

Community
  • 1
  • 1
Aman Gautam
  • 3,549
  • 2
  • 21
  • 25
  • Sorry, I forgot to say I need an offline solution. I'm not quite sure if Android Backup Service fits in my case, as ABS seems to require an internet connection to recover data. Thanks for the suggestion, though! – horta Aug 12 '13 at 16:32