Skip to content

Forteanjo/country_flags

Repository files navigation

Country Flags Android App

License Kotlin Compose

Table of Contents

  1. Overview
  2. Features
  3. Screenshots
  4. Tech Stack & Libraries
  5. Setup & Installation
  6. API
  7. Project Structure (Brief)
  8. Error Handling
  9. Future Enhancements (Optional)
  10. Contributing (Optional)
  11. License

Overview

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. *

Features

  • 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.)

Screenshots

Main List Screen Detail Screen (if any)
Screenshot 1 Screenshot 2

Tech Stack & Libraries

  • UI:
  • Architecture:
    • MVVM (Model-View-ViewModel): Separation of concerns.
  • Dependency Injection:
    • Koin: Pragmatic lightweight dependency injection framework.
  • Networking:
  • Data Persistence:
  • Asynchronous Programming:
  • Build Tool:
    • Gradle
  • Language:
    • Kotlin

Setup & Installation

  1. Clone the repository:
  2. Open in Android Studio:
    • Open Android Studio.
    • Click on "Open an Existing Project".
    • Navigate to the cloned repository folder and select it.
  3. Build the project:
    • Android Studio should automatically sync and build the project. If not, click on Build > Make Project.
  4. 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)

API

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

Project Structure

Error Handling

  • 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.")

Future Enhancements

  • 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.

Contributing

Contributions are welcome! If you'd like to contribute, please follow these steps:

  1. Fork the repository.
  2. Create a new branch (git checkout -b feature/your-feature-name).
  3. Make your changes.
  4. Commit your changes (git commit -m 'Add some feature').
  5. Push to the branch (git push origin feature/your-feature-name).
  6. Open a Pull Request.

Please make sure to update tests as appropriate.

License

This project is licensed under the MIT License - see the LICENSE file for details.

Contact

Donald McCaskey - forteanjo@sky.com

About

Investigating the Navigator 3 library

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages