我正在尝试通过使用 Room 库指定其路径来访问 Android 内部存储上的数据库。到目前为止,我一直在使用以下语句来完成此操作:
dbPath = "/data/data/my.sqlitetesting/files/database/myDataBase.db";
SQLiteDatabase.openDatabase(dbPath, null, SQLiteDatabase.OPEN_READWRITE);
如何使用 Room 访问此数据库?
最佳答案
据我所知,import db file to room 目前还不行。但还有另一种方式:How to use Room Persistence Library with pre-populated database?
您也可以试试这个库:RoomAsset
关于android - 使用 Room 打开具有指定路径的 SQLite 数据库,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46584406/