Giter Site home page Giter Site logo

skydoves / pokedex-compose Goto Github PK

View Code? Open in Web Editor NEW
525.0 4.0 89.0 9.38 MB

🗡️ Pokedex Compose demonstrates modern Android development with Jetpack Compose, Hilt, Coroutines, Flow, Jetpack (Room, ViewModel), and Material Design based on MVVM architecture.

License: Apache License 2.0

Kotlin 100.00%
android coroutines hilt jetpack-android jetpack-compose kotlin motion mvvm mvvm-architecture pokedex pokemon skydoves

pokedex-compose's Introduction

Pokedex Compose

License API Build Status
Google Medium Profile Profile

🗡️ Pokedex Compose demonstrates modern Android development with Jetpack Compose, Hilt, Coroutines, Flow, Jetpack (Room, ViewModel), and Material Design based on MVVM architecture.

Tip

If you want to see the XML version of Pokedex, check out the Pokedex repository.

Download

Go to the Releases to download the latest APK.

Tech stack & Open-source libraries

  • Minimum SDK level 21.
  • Kotlin based, utilizing Coroutines + Flow for asynchronous operations.
  • Jetpack Libraries:
    • Jetpack Compose: Android’s modern toolkit for declarative UI development.
    • Lifecycle: Observes Android lifecycles and manages UI states upon lifecycle changes.
    • ViewModel: Manages UI-related data and is lifecycle-aware, ensuring data survival through configuration changes.
    • Navigation: Facilitates screen navigation, complemented by Hilt Navigation Compose for dependency injection.
    • Room: Constructs a database with an SQLite abstraction layer for seamless database access.
    • Hilt: Facilitates dependency injection.
  • Architecture:
    • MVVM Architecture (View - ViewModel - Model): Facilitates separation of concerns and promotes maintainability.
    • Repository Pattern: Acts as a mediator between different data sources and the application's business logic.
  • Retrofit2 & OkHttp3: Constructs REST APIs and facilitates paging network data retrieval.
  • Sandwich: Adaptable and lightweight sealed API library designed for handling API responses and exceptions in Kotlin for Retrofit, Ktor, and Kotlin Multiplatform.
  • Moshi: A modern JSON library compatible with Kotlin and Java.
  • ksp: Kotlin Symbol Processing API for code generation and analysis.
  • Turbine: A small testing library for kotlinx.coroutines Flow.
  • Landscapist Glide, animation, placeholder: A pluggable, highly optimized Jetpack Compose and Kotlin Multiplatform image loading library that fetches and displays network images with Glide, Coil, and Fresco.
  • Baseline Profiles: Enhances app performance by including specifications of classes and methods in the APK that can be utilized by Android Runtime.

Technical Contents

If you're interested in learning the tech stacks used to build Pokedex Compose, you can find detailed information in the articles linked below:

Architecture

Pokedex Compose adheres to the MVVM architecture and implements the Repository pattern, aligning with Google's official architecture guidance.

architecture

The architecture of Pokedex Compose is structured into two distinct layers: the UI layer and the data layer. Each layer fulfills specific roles and responsibilities, outlined as follows:

Pokedex Compose follows the principles outlined in the Guide to app architecture, making it an exemplary demonstration of architectural concepts in practical application.

Architecture Overview

architecture

  • Each layer adheres to the principles of unidirectional event/data flow: the UI layer sends user events to the data layer, and the data layer provides data streams to other layers.
  • The data layer operates autonomously from other layers, maintaining purity without dependencies on external layers.

This loosely coupled architecture enhances component reusability and app scalability, facilitating seamless development and maintenance.

UI Layer

architecture

The UI layer encompasses UI elements responsible for configuring screens for user interaction, alongside the ViewModel, which manages app states and restores data during configuration changes.

  • UI elements observe the data flow, ensuring synchronization with the underlying data layer.

Data Layer

architecture

The data layer is composed of repositories that handle business logic tasks such as retrieving data from a local database or fetching remote data from a network. This layer is designed to prioritize offline access, functioning primarily as an offline-first repository of business logic. It adheres to the principle of "single source of truth," ensuring that all data operations are centralized and consistent.

Pokedex Compose is an offline-first app, meaning it can perform all or most of its essential functions without an internet connection. This design allows users to access core features reliably, regardless of network availability, reducing their need for constant updates and decreasing data usage. For more details on how to build an offline-first application, you can visit Build an offline-first app.

Modularization

Pokedex Compose adopted modularization strategies below:

  • Reusability: Modulizing reusable codes properly enable opportunities for code sharing and limits code accessibility in other modules at the same time.
  • Parallel Building: Each module can be run in parallel and it reduces the build time.
  • Strict visibility control: Modules restrict to expose dedicated components and access to other layers, so it prevents they're being used outside the module
  • Decentralized focusing: Each developer team can assign their dedicated module and they can focus on their own modules.

For more information, check out the Guide to Android app modularization.

Open API

Pokedex using the PokeAPI for constructing RESTful API.
PokeAPI provides a RESTful API interface to highly detailed objects built from thousands of lines of data related to Pokémon.

Find this repository useful? ❤️

Support it by joining stargazers for this repository. ⭐
Also, follow me on GitHub for my next creations! 🤩

License

Designed and developed by 2024 skydoves (Jaewoong Eum)

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

   http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

pokedex-compose's People

Contributors

cbeyls avatar cmhhelgeson avatar ham2174 avatar hemantj99 avatar skydoves avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

pokedex-compose's Issues

Create Build issue.

e: file:///E:/composesamples/pokedex-compose-main/build-logic/convention/src/main/kotlin/com/skydoves/pokedex/compose/AndroidCompose.kt:13:35 5 type arguments expected for interface CommonExtension<BuildFeaturesT : BuildFeatures, BuildTypeT : BuildType, DefaultConfigT : DefaultConfig, ProductFlavorT : ProductFlavor, AndroidResourcesT : AndroidResources>
e: file:///E:/composesamples/pokedex-compose-main/build-logic/convention/src/main/kotlin/com/skydoves/pokedex/compose/AndroidCompose.kt:18:5 Unresolved reference: buildFeatures
e: file:///E:/composesamples/pokedex-compose-main/build-logic/convention/src/main/kotlin/com/skydoves/pokedex/compose/AndroidCompose.kt:19:7 Unresolved reference: compose

using android studio version

Android Studio Hedgehog | 2023.1.1
Build #AI-231.9392.1.2311.11076708, built on November 9, 2023
Runtime version: 17.0.7+0-b2043.56-10550314 amd64
VM: OpenJDK 64-Bit Server VM by JetBrains s.r.o.
Windows 10.0

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.