Reference no: EM133395630
Question 1: Develop an app in Android Studio that uses a Recycler View to show list of Vaccinated and Unvaccinated people. The app should start by showing a list of all the unvaccinated people. You can write a function to generate some dummy data at the start of the MainActivity that would generate some data and add that data to a table called Person in the Database. As soon as the data is generated and added to the Database, your app should fetch that data from the Person table in the Database and show that data in a Recycler View. The first screenshot below shows the MainActivity on its launch. You can see the data is available in the Recycler View. Please note that the data is generated and then stored in a Person table in the database and then fetched from the database to show it in a Recycler View. All of this is happening at the start of your app. Person table in the database should contain 4 columns; int id, String first_name, String last_name and String gender. MainActivity should show the fetched First Name, Last Name and Gender along with an Icon to be shown in the Recycler View.
On the click of the checkbox icon in each row of the recycler view, that row should be added to another table in the Database called Vaccinated. The Vaccinated table should have the same columns as Person table, e.g., int id, String first_name, String last_name andString gender. As soon as the record is added to the Vaccinated table, this record should be deleted from the Person table and the Recycler View should be updated so that the deleted record is not shown in the Recycler View.
The second screenshot above shows the state of the MainActivity when 3 records are added to the Vaccinated table and hence are removed from the Person table which makes Recycler View to update itself to show the remaining records in the table.
There is a Floating Action Button on the MainActivity as shown in both First and Second screenshot. As soon as the Floating Action Button is clicked, it should take you to the next Activity, you can call it VaccinatedActivity. Just like the MainActivity, this activity should fetch the data from the Vaccinated table in the database and show it in a Recycler View. Third screenshot shows the state of VaccinatedActivity when 3 rows deleted from MainActivity were added to the Vaccinated table and the data is fetched from that table to show in a Recycler View in Vaccinated Activity.
Please note the followings:
You are required to use a Recycler View to design this app
You should have two Activities, MainActivity and VaccinatedActivity
Use Room Database with at least 2 tables, Person and Vaccinated to store the data
Make sure use appropriate files, Entity, Dao and AppDatabase for storing, fetching and deleting data to and from the database
Create separate Adapter classes to handle Recycler View Adapters for both the Activities.
Create separate row_layout files for both the Recycler Views and inflate them accordingly.
Make sure Floating Action Button takes you to the Vaccinated Activity.
For returning to the MainActivity from VaccinatedActivity, you can use back button of the emulator (no need to use own back button)
Note that each Activity should have an appropriate title as shown in the screenshot as well, e.g., MainActivity title is "Unvaccinated People" and VaccinatedActivity title is "Vaccinated People".
Generate at least a list of 10 Unvaccinated people at the start of the app.
Question 2. Develop an app in Android Studio that displays the boxes as shown in the screenshot below. The design you see in the screenshot is using a GridLayoutManager which helps in creating a grid layout.
Please note the followings:
You have to design the above layout using RecyclerView and GridLayoutManager
Create an Adapter for RecyclerView to show at least 32 purple boxes
Make sure each row of the RecyclerView contains max. of 4 boxes
Create a row_layout.xml file that contains only 1 box (you can create a box using CardView). Set the height and width of the box to 80dp. Use this row_layout.xml to inflate in Adapter class.