/PokemonApp

Pokemon app using the MVVM design pattern, integrating Jetpack Compose for the UI, Coroutines for concurrency, Dagger Hilt for dependency injection and Retrofit for network operations.

Primary LanguageKotlin

Pokemon

Pokemon app using the MVVM design pattern, integrating Jetpack Compose for the UI, Coroutines for concurrency, Dagger Hilt for dependency injection and Retrofit for network operations.


 


Open APIs🔗


Pokemon uses the PokeApi to get information from the server. The PokeApi has a lot of details about the main Pokémon games and offers them through a RESTful API. game series.


Architecture🏗️

Pokemon App uses the MVVM architecture to separate UI and Data components, ensuring a clear separation of concerns, driving the UI from data models, maintaining a single source of truth, and enforcing unidirectional data flow for a more maintainable and testable Android app.

Architecture Overview

By adapting architectural layering, the Pokemon App follows a unidirectional data flow, responding accordingly to user events and updating UI states.

UI Layer🖼️

The UI layer serves as the primary point for user interactions and displays the application data. It should update whenever the app data changes, reflecting changes made by either user interaction or external input./p>

  • Depending on user interactions, the main activity hosts the navigation controller and navigates through two screens: PokemonListScreen and PokemonDetailScreen.
  • The PokemonListViewModel requests data from the data layer, and the PokemonListScreen updates its UI by observing the states managed by the ViewModel.
  • The responsibility of the PokemonDetailViewModel is to fetch Pokemon details and update the states for the PokemonDetailScreen.

Data Layer👾

The data layer is responsible for containing application data and business logic. It consists of repositories and data sources. Keeping each repository as a single source of truth is crucial.

  • PokemonRepository requests data from the remote data source and serves as a single source of truth.
  • PokemonRepository uses the Retrofit library to send requests to the PokeAPI server and retrieve network responses.

Tech Stack🚀

  • Minumum SDK Level: 21
  • Target SDK Level: 34
  • 100% Kotlin
  • Architecture
    • MVVM Pattern: Industry-recognized software architecure pattern supported by Google
  • Jetpack Compose:Using a declarative programming model, modern toolkit for building Android user interfaces.
  • Coroutines: Concurrency design patterns offered by Kotlin
  • ViewModel: As a state holder, it exposes data streams.
  • Coil : A lightweight image loading library for Android backed by Kotlin Coroutines.
  • Hilt: A dependency injection library built on top of Dagger gains advantages such as compile-time correctness, runtime performance, scalability, and support within Android Studio.
  • Retrofit: A REST client for Android, Java, and Kotlin, developed by Square, known for its type-safe nature
  • OkHttp : A third-party library built on top of the Okio library, used for sending and receiving HTTP-based network requests
  • Timber : Logging utility library commonly used in Android development for logging messages and debugging information