保存的SQLite数据库到文件? [英] Save SQLite DB to a file?
问题描述
我有一个创建一个SQLite数据库,并与一些数据填充它一个Android应用程序。
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 application?
推荐答案
您可以从Eclipse中的DDMS percpective访问SQLite数据库文件的设备连接时,它存储在您的应用程序的文件/数据/数据/包名/数据库。
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.
有是如何找到并通过preSET文件替换数据库指南:
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/
或者你也可以创建一个SQL命令转储,并在其首次推出执行初始化 - 但它会耗费时间真的
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数据库到文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!