Question: Develop an Android application that will maintain a list of contacts in a RecyclerView. Every contact will have a name, telephone number and gender. Your
Develop an Android application that will maintain a list of
contacts in a RecyclerView. Every contact will have a name, telephone number and
gender. Your RecyclerView must display every contact's name and telephone number and
display the correct picture depending on the contact's gender.
Figure1 below shows the
layout of each contact on the Recycler view. When the user clicks on an item in the
RecyclerView, a new activity should be opened. This activity will show the contact's name
and a picture representing the gender of the contact. At the bottom, your application should
provide a button (clickable CardView with TextView and ImageView) to call the Tel number
provided for that contact (see Figure 2 below). A demonstration of the application will be
provided.
MAIN ACTIVITY AND THE RECYCLERVIEW
Follow the steps below to make your RecyclerView:
1. Make a new Android Studio project and implement the libraries for CardView
and RecyclerView. Make use of the colors.xml and strings.xml files.
2. Make a custom class called "Contact" that will represent every element in the
RecyclerView. This class must have fields for the contact's name (String), the
contact's telephone number (String) and the contact's gender (String).
3. Make a custom layout file called "row_layout" that will represent every element
in the RecyclerView. The layout should look like this:
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
