Watch Part 2: • Android NavigationView + RecyclerView Menu...
In this tutorial I will show you how to populate room persistence database with initial data at the time of creation.
Also I will show you how to
create Repository to access room database
create ViewModel
create RecyclerView Adapter
And create observer to observe the data that is inserted into room database.
I have already created empty project based on Navigation Drawer Activity and created Application class and Executor class.
STEP 1: Add Dependency
I added the following dependency
STEP 2: Create Entity
create the data that will be populated during room database creation
I populate almost 1000 record, I will past them now,
I cannot write that amout of records
STEP 3: Create Dao
STEP 4: Create Database & Executor
STEP 5: Create Repository
STEP 6: Create ViewModel
STEP 7: Create Fragment & Item Layout
create the movie item layout
STEP 8: Create RecyclerView Adapter
STEP 9: Configure the fragment to use the ViewModel we created and observer the room persistance database
Slow Jam Kevin MacLeod (incompetech.com)
Licensed under Creative Commons: By Attribution 3.0 License
http://creativecommons.org/licenses/b...