保存的SQLite数据库到文件? [英] Save SQLite DB to a file?

查看:178
本文介绍了保存的SQLite数据库到文件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个创建一个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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆