开发者

Save SQLite DB to a file?

I have an Android application that creates a SQLite DB and populates it with some data.

How do I save this database to a file so it can be shipped with another applicatio开发者_StackOverflown?


You can access the SQLite database file from the DDMS percpective of Eclipse when the device is connected, it is stored with your application's files in /data/data/package_name/databases.

There is a guide on how to find and replace a database by a preset file:

http://www.reigndesign.com/blog/using-your-own-sqlite-database-in-android-applications/

Or you can just create an SQL command dump, and make it execute on first launch is initialized - however it will be realy time consuming.


sqlite saves its data directly to a file. It's already done. The filename is specified in your connection string.

Are you trying to export to a different file type for some other software to read in?


To export your SQLite data to a file, use the .dump command. See Exporting from SQLite to SQL Server

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜