包装的SQLite数据库与我的应用程序 [英] Packaging SQLite DB with my application
本文介绍了包装的SQLite数据库与我的应用程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我已经在我的电脑上创建一个SQLite数据库。我已经导入到我的的资产的文件夹中的项目目录。如何从我的Android应用程序访问它?
I have created a SQLite database on my PC. I have imported it into my assets folder in the project directory. How do I access it from my Android application?
推荐答案
它复制到你的数据库目录( getDatabasePath()
)使用Java I / O。在这一点上,你可以使用它像一个正常的数据库。它不可能从自己的资产中使用它。
Copy it into your database directory (getDatabasePath()
) using Java I/O. At that point, you can use it like a normal database. It is impossible to use it from within the assets themselves.
这篇关于包装的SQLite数据库与我的应用程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文