我已经在我的电脑上创建一个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.