Here is an example of these new features which Room 2.2.0 supports.
1) Store the .db
file in your assets folder and which is prepopulated using some online tool
2) then just load it using below code
Room.databaseBuilder(appContext, AppDatabase.class, "Sample.db")
.createFromAsset("database/myapp.db")
.build()
3) Create models or entities and other database set up to handle this data when you query on them
For full room using sample follow this doc
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.