Example of the local database using the new room Persistence library (simply say SQLite). In this demo I will perform all the basic DB operations like ADD, DELETE, UPDATE.
Also, I use ExecutorService instead of Async Task because it gets depreciated in android API level 30.
Checkout this developer documentation https://developer.android.com/topic/libraries/architecture/room
How to save data in local database check this link https://developer.android.com/training/data-storage/room