- Overview
- Features
- Screenshots
- Tech Stack & Libraries
- Setup & Installation
- API
- Project Structure (Brief)
- Error Handling
- Future Enhancements (Optional)
- Contributing (Optional)
- License
The Country Flags app is an Android application built using modern Android development practices. It displays a list of countries along with their flags, capitals, and populations. Users can view details for each country. The app demonstrates the use of Jetpack Compose for the UI, Koin for dependency injection, Ktor for networking, and Room for local data persistence. *
- Displays a list of countries with their flags.
- Shows details for each country:
- Name
- Capital
- Population (formatted)
- Flag image
- Fetches country data from a remote API.
- Caches data locally using Room database for offline access and faster loading.
- Utilizes a responsive UI built with Jetpack Compose.
- Handles network errors gracefully.
- (Add any other specific features your app has, e.g., search functionality, sorting, dark mode, etc.)
| Main List Screen | Detail Screen (if any) |
|---|---|
![]() |
![]() |
- UI:
- Jetpack Compose: Modern toolkit for building native Android UI.
- Material 3: Design system.
- Coil: Image loading library for Compose.
- Architecture:
- MVVM (Model-View-ViewModel): Separation of concerns.
- Dependency Injection:
- Koin: Pragmatic lightweight dependency injection framework.
- Networking:
- Ktor Client: Asynchronous HTTP client.
- Kotlinx Serialization: For JSON parsing.
- Data Persistence:
- Room Persistence Library: Local database for caching.
- Asynchronous Programming:
- Kotlin Coroutines: For managing background threads and asynchronous operations.
- Build Tool:
- Gradle
- Language:
- Kotlin
- Clone the repository:
- Open in Android Studio:
- Open Android Studio.
- Click on "Open an Existing Project".
- Navigate to the cloned repository folder and select it.
- Build the project:
- Android Studio should automatically sync and build the project. If not, click on
Build > Make Project.
- Android Studio should automatically sync and build the project. If not, click on
- Run the app:
- Select an emulator or connect a physical Android device.
- Click the "Run" button (green play icon) in Android Studio.
Prerequisites:
- Android Studio (latest stable version recommended - e.g., Iguana | 2023.2.1 or newer)
- Android SDK
- (Specify if a particular API level is required for building or running, e.g., Min SDK 24)
This project fetches country data from the following API:
- API Name: ApiCountries - The Free RESTful Countries Data API
- Base URL:
https://www.apicountries.com/(or the specific base URL Ktor is configured with) - Endpoint Used:
/countries - Authentication: n/a
- Network request errors (e.g., timeouts, HTTP errors) are caught in the repository layer.
- The UI is updated to reflect loading states or error messages.
- (Mention specific strategies, e.g., "Uses a NetworkResult sealed class to propagate success/error states to the ViewModel.")
- Search functionality for countries.
- Sorting countries by name, population, etc.
- Offline mode improvements (e.g., more robust conflict resolution).
- Dark mode theme.
- Unit and UI tests.
- Detailed country screen.
Contributions are welcome! If you'd like to contribute, please follow these steps:
- Fork the repository.
- Create a new branch (
git checkout -b feature/your-feature-name). - Make your changes.
- Commit your changes (
git commit -m 'Add some feature'). - Push to the branch (
git push origin feature/your-feature-name). - Open a Pull Request.
Please make sure to update tests as appropriate.
This project is licensed under the MIT License - see the LICENSE file for details.
Donald McCaskey - forteanjo@sky.com

