This project displays a list of countries. Each item shows country name followed by the region followed by the country code. The capital of the country is displayed in the next line if available. If the capital is not available, the view changes accordingly.
This app uses a combination of the MVVM, Clean architecture, and Repository patterns to organize its code. MVVM separates the UI from the business logic, and Clean architecture takes this separation a step further by dividing the code into modules with specific responsibilities. This makes the code easier to maintain and modify. The Repository pattern is used to separate the data layer from the UI and domain layer. The app demonstrates the use of Retrofit to make REST requests to a web service, and Moshi to deserialize the JSON response into Kotlin data objects. For the UI, the app uses ViewModel, LiveData, and Data Binding with binding adapters. The Paging Library is used to get paged data from the network. For dependency injection, the app uses Hilt, which is a wrapper around Dagger.
This app demonstrates the use of:
- Retrofit to make REST requests to the web service
- Moshi to handle the deserialization of the returned JSON to Kotlin data objects
- For UI - ViewModel, LiveData, Data Binding with binding adapters
- Paging Library to get paged data from the network.
- For dependency injection it uses Hilt which is a wrapper around Dagger
- Minimum SDK level 19
- Written in Kotlin
- Coroutines for asynchronous operations
- Retrofit for constructing the REST APIs and paging network data
- Moshi for A modern JSON library for Kotlin and Java
- Hilt for dependency injection
- Android Jetpack
- Lifecycle for observing data when lifecycle state changes
- ViewModel for UI Related data holder, lifecycle aware
- Databinding for view Binding + Bind data from view to ViewModel
- Android Paging v3 - Get paged data from network, display list using PagingDataAdapter in a recyclerView
- Install Android Studio, if you don't already have it.
- Download the sample.
- Import the sample into Android Studio.
- Build and run the sample.
Added test cases to ensure the data in the view is being loaded properly
- Improve the user interface to make it more user-friendly and visually appealing.
- Show the selection of items in the app, such as which items are currently selected.
- Add a pull-to-refresh feature, which allows the user to swipe down to refresh the data displayed in the app.
- Introduce an offline-first architecture by using Room, a local database library, to store data locally and improve the app's performance and reliability.
- Leverage Paging Library
- Showing page loader status
- Error & Retry Mechanism