CST2335 – Graphical Interface Programming
Lab 7
Introduction:
The goal of this lab is to learn how to work with Room Database in Android.
Steps:
1.
Using ROOM database -
https://brightspace.algonquincollege.com/d2l/le/content/569308/viewContent/8656226/View
2.
Creating a Data Access Object (DAO) -
https://brightspace.algonquincollege.com/d2l/le/content/569308/viewContent/8656228/View
3.
Using AlertDialog and Snackbar -
https://brightspace.algonquincollege.com/d2l/le/content/569308/viewContent/8656227/View
Demonstrate your lab work to your lab professor.
Marking Guide:
S/N
Item
Mark
1
Selecting a message shows an Alert Dialog asking if you want to
delete the message
1
2
Clicking "Yes" or the positive message deletes the message from the
list, and deletes from the database using the ChatRoomDao object.
1
3
Deleting a message shows a Snackbar with an UNDO button.
Clicking on the UNDO button inserts the message back into the list.
2
4
You have the proper annotations for the ChatMessage class
(@Entity, @PrimaryKey, @ColumnInfo)
3
5
You have the proper DAO class with annotation (@DAO, @Insert,
@Query, @Delete)
1
6
Adding a ChatMessage also inserts the message into the database
1
Total
9