且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

如何在 Android 中访问现有的 sqlite 数据库?

更新时间:2023-09-21 13:15:46

查看 android.database.sqlite.SQLiteDatabase.

特别是,有一个 openDatabase() 命令可以访问给定文件路径的数据库.

In particular, there's an openDatabase() command that will access a database given a file path.

SQLiteDatabase db = SQLiteDatabase.openDatabase(path, null, 0);

只需将数据库路径指定为 path 变量,它应该可以工作.

Just specify the path to your database as the path variable, and it should work.