0

am new to room database i am having one doubt i have downloaded the room database from google drive and stored it in local file manager from that path how can i manage room database i have searched a lot but none of it helped me so please someone tell me how to do this now let me post what i have tried so far:

Room.databaseBuilder(context, RoomDB.class, "storage/emulated/0/mm/mm.db") .allowMainThreadQueries().build();

i have give file path to builder method but everytime while inserting am getting new value can someone help me ! Thanks in advance

M.Yogeshwaran
  • 1,419
  • 4
  • 22
  • 48

1 Answers1

0

In order to do this, you must first copy your database file to data/data/YOUR_PACKAGE_NAME/databases/, before running any queries.

Take a look at this and this for more informations and working examples.

Michał Pawlik
  • 756
  • 1
  • 9
  • 17