Database is an abstract class (extend from RoomDatabase) handles the communication between DAOs and Repository
It is necessary to have sub-threads in repository instead of main thread. It prevents application to freeze when read and write data.
Only one Database for one application
Database is an abstract class (extend from RoomDatabase) handles the communication between DAOs and Repository It is necessary to have sub-threads in repository instead of main thread. It prevents application to freeze when read and write data. Only one Database for one application
LAST UPDATE: Nov 30th, 2024
Variables: String DATABASE_NAME String USER_TABLE String RESTAURANT_NAME Database INSTANCE int THREADS_COUNT ExecutorService databaseExecutor
Methods: Database getDatabase(Context context) RoomDatabase.Callback defaultValues UserDAO getUserDAO( ); RestaurantDAO getRestaurantDAO( )