views:

821

answers:

2

My Android application stores all user data in a Sqlite database. What are my options to backup/export/import/copy this data? I know I can easily copy the database to the SD card. I would also like to send the data to a network server. Are there any packages/classes available to facilitate getting sqlite information to/from a network server? Thanks for the help...

A: 

SQLite data base files are just flat files, that I am pretty sure is platform portable. So the only issue about getting data two or from a network is exactly equal to your ability to access the file itself. The point being that you can run the SQLite demo program itself on whatever platform you like to access to data directly, or share the file over a network and use the SQLite C library directly on it, or copy the file then use the local copy as you like.

Paul Hsieh
I can verify their portability. An app I'm working on builds a SQLite3 db on a server and the app downloads/uses it. There's an iPhone app that works with it too.
fiXedd
Any idea about the path in which the DB file is stored ?
Guido
A: 

Your best bet is to store the db on the external storage. If you use the built in (automagic) databases you won't be able to directly access the file. Once it's on the SDCard (or future storage options) you can just upload the file to the server using one of the standard HTTP libraries.

One of the apps I've been working on does something similar, but in reverse. We're downloading a SQLite3 DB from a server then storing it to the external storage (SDCard).

fiXedd