Android Room Database Operations, Insert Update Delete || Android Studio Tutorial
9.7 هزار بار بازدید -
4 سال پیش
-
#larntech
#larntech #roomdatabase #viewmodel #mvvm #update #delete
Android Room Database Operations, Insert Update Delete || Android Studio Tutorial
For additional help/customization and tasks reach me via.
www.fiverr.com/share/ADdzzR
In this tutorial, we shall learn room database operations, Insert Update Delete, and Query.
This is part two of my previous tutorials on Room Database, ViewModel, LiveData, RecyclerView (MVVM) || Android Architecture Component
Be sure to check it here so that you can understand this one better.
• Room Database , ViewModel , LiveData,...
Room Database being an architectural component that allows fluent database access in mobile applications.
Major Components in Room Database:
1. Database:
This is the main access point for the underlying connection to your app’s persistent relational data.
Usually annotated with @Database.
An abstract class that extends RoomDatabase.
It contains an abstract class that has no arguments which returns class annotated with @Dao.
It contains a list of entities.
2. Entity:
Represents tables in the database.
3. Dao:
It contains methods used to access the database.
Step we have followed in this tutorial to Insert Update and Delete Items in room database.
1. Creating a menu item (delete and update)
2. Adding image view which when clicked inflate the menu item
3. Adding a click listener to delete and update
4. Including @delete and @update in @Dao methods.
5. Updating the repository and view model with delete and update method.
6. Performing delete and update when a menu item is clicked.
Thanks for watching if you are not subscribed. Kindly subscribe for more tutorials.
Subscribe link: youtube.com/c/larntech20?sub_confirmation=1
For additional help, feel free to comment below.
4 سال پیش
در تاریخ 1399/02/20 منتشر شده
است.
9,745
بـار بازدید شده