$25
Task:
You are to refactor the MyOrder app that you created for assignment 2 that allows the user to place an order for coffee and display the list of orders placed. The app should provide following functionalities:
• (25 points) Set up the Room database (Entity, DAO and Database) that will allow you to store coffee order details. Considering the practice done in class, determine the entity attributes and their data types. In DAO interface, add the necessary functions and queries for CRUD operations.
• (25 points) You must organize your code as per Android Jetpack architecture components practiced in the class. There must be clear separation of concerns between UI and database operations classes. No database operation should be performed directly from UI thread. You must create repository class and viewmodel class for database access. The database must be accessed in the Activity only using the view model.
• (15 points) The first screen that allows the user to choose the details of their order should now save the order details in the Room DB instead of array of objects. Each record to be stored in Room should at least contain id, coffee_type, size and quantity. If user wants to place another order, you are to add another record in Room.
• Note: Now, you just have to open the next screen when the options menu item is clicked. You won’t need to send the data along.
• (15 points) The second screen that displays a RecyclerView should now display all the orders fetched from Room DB. Each RecyclerView cell should display selected coffee, its size and quantity.
• (20 points) The RecyclerView should allow the user to update the number of coffee (quantity) in specific order. Also, allow the user to delete any order from the list.