$25
Task:
You are to create an Android application named as YourFirstname_Vacation as per the specifications given below:
The app will consist of two (2) screens:
1. Main Screen: This screen displays a list of countries
2. Favorite List Screen: This screen displays a list of countries that the user marked as favourite
Details about each screen are provided below.
Main Screen:
● This screen displays a list of countries in a RecyclerView. Use this API to fetch a list of countries: https://restcountries.eu/rest/v2/all
● Each row of the RecyclerView must display the country name, capital, and image of the country’s flag.
● The country name and capital are obtained from: https://restcountries.eu/rest/v2/all
● The image of the country’s flag must be obtained from https://www.countryflags.io/XX/flat/64.png, where XX is the country code. You must use the country code obtained from https://restcountries.eu/rest/v2/all to construct the URL for connecting to and fetching the image from countryflags.io. Hint: You should use Picasso or Glide library for getting the images displayed.
● A user can mark a country as “favourite” by tapping on a row in the RecyclerView. You must save the user’s favorite country in a Room or Cloud Firestore database.
● Finally, provide an options menu to the user on main screen through which they should be able to open a new screen to view favorite list screen.
● Bonus (5%) : While adding country to favourite list on Firestore, check if the country already exists on the fav list; if yes, don’t add it on Firestore and display appropriate message to the user.
Favourite List Screen:
● Upon opening this screen, the app should fetch all the favourite countries from database and display them in a RecyclerView. Each item of the RecyclerView must show the country name and image of the flag. Flag images should be obtained using Glide/Picasso from https://www.countryflags.io/XX/flat/64.png, where XX is the country code.
● When the user taps on a row in the RecyclerView, remove the country from the user’s favorites list which must be reflected in database.