Skip to content

An app built with Jetpack compose, as a refresher on paging3 and local caching using room database

Notifications You must be signed in to change notification settings

robert-muriithi/Rick-and-Morty

Repository files navigation

Rick and Morty

An Android app consuming Rick and Morty API to display list of characters, built with MVVM pattern as well as Architecture Components.

Prerequisite

This project uses the Gradle build system. To build this project, use the gradlew build command or use "Import Project" in Android Studio.

The App

The app loads the the characters from the api displays them in a list. Data from the api is paginated, so RemoteMediator comes in handy. This library defines a set of callbacks used to incrementally load data from a remote source into a local source wrapped by a PagingSource, e.g., loading data from network into a local db cache(room db) for my case

Screenshots

Tech Stack.

This project uses many of the popular libraries, plugins and tools of the android ecosystem.

  • Kotlin - Kotlin is a programming language that can run on JVM. Google has announced Kotlin as one of its officially supported programming languages in Android Studio; and the Android community is migrating at a pace from Java to Kotlin.

  • Jetpack components:

    • Jetpack Compose - Jetpack Compose is Android’s modern toolkit for building native UI. It simplifies and accelerates UI development on Android. Quickly bring your app to life with less code, powerful tools, and intuitive Kotlin APIs.
    • Android KTX - Android KTX is a set of Kotlin extensions that are included with Android Jetpack and other Android libraries. KTX extensions provide concise, idiomatic Kotlin to Jetpack, Android platform, and other APIs.
    • AndroidX - Major improvement to the original Android Support Library, which is no longer maintained.
    • Lifecycle - Lifecycle-aware components perform actions in response to a change in the lifecycle status of another component, such as activities and fragments. These components help you produce better-organized, and often lighter-weight code, that is easier to maintain.
    • ViewModel -The ViewModel class is designed to store and manage UI-related data in a lifecycle conscious way.
    • Room database - The Room persistence library provides an abstraction layer over SQLite to allow fluent database access while harnessing the full power of SQLite.
  • Kotlin Coroutines - A concurrency design pattern that you can use on Android to simplify code that executes asynchronously.

  • Retrofit - Retrofit is a REST client for Java/ Kotlin and Android by Square inc under Apache 2.0 license. Its a simple network library that is used for network transactions. By using this library we can seamlessly capture JSON response from web service/web API.

  • GSON - JSON Parser,used to parse requests on the data layer for Entities and understands Kotlin non-nullable and default parameters.

  • Kotlin Flow - In coroutines, a flow is a type that can emit multiple values sequentially, as opposed to suspend functions that return only a single value.

  • Dagger Hilt - A dependency injection library for Android that reduces the boilerplate of doing manual dependency injection in your project.

  • Ramcosta Navigation Library - A KSP library that processes annotations and generates code that uses Official Jetpack Compose Navigation under the hood. It hides the complex, non-type-safe and boilerplate code you would have to write otherwise.

  • Logging Interceptor - logs HTTP request and response data.

  • Paging-3 - The Paging library helps you load and display pages of data from a larger dataset from local storage or over network. This approach allows your app to use both network bandwidth and system resources more efficiently.

  • Coil- An image loading library for Android backed by Kotlin Coroutines.

  • Timber- A logger with a small, extensible API which provides utility on top of Android's normal Log class.

  • Chucker- Chucker simplifies the inspection of HTTP(S) requests/responses fired by your Android App. Chucker works as an OkHttp Interceptor persisting all those events inside your application, and providing a UI for inspecting and sharing their content.

About

An app built with Jetpack compose, as a refresher on paging3 and local caching using room database

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages