简体   繁体   中英

Exporting Sqlite data from an Android Application

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...

在那里看到我的答案: Android Utility将sqlite db发送到服务器

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.

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).

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM