Movie catalog application that illustrates best practices for developing Android. This repository contains detailed application examples that implement Clean Architecture with MVVM patterns using Modularization, Dynamic Features, Kotlin DSL, Material Design, Night Mode, Data Binding, Retrofit2, Moshi, RxJava2, Dagger2, Room, SQLCipher, and ProGuard. Classes have been designed in such a way that it could be inherited and maximize the code reuse.
This is the big picture, which should look familiar if you have been using Clean Architecture in your Android Applications.
The general principle is to use a basic 3 tiers architecture. The good thing about it, is that it is very easy to understand and many people are familiar with it. So we will break down our solution into layers in order to respect the dependency rule (where dependencies flow in one direction: check above the rounded clean architecture graph):
Movie Catalogue uses TheMovieDB API to load a catalog of movies available on the screen.
Once you have the key, add this line to the gradle.properties
file, either in your user home
directory (usually ~/.gradle/gradle.properties
on Linux and Mac) or in the project's root folder:
API_KEY = <YourMovieDB access key>
light and dark theme display
- AppCompat - Degrade gracefully on older versions of Android.
- Android KTX - Write more concise, idiomatic Kotlin code.
- Data Binding - Declaratively bind observable data to UI elements.
- Lifecycles - Create a UI that automatically responds to lifecycle events.
- LiveData - Build data objects that notify views when the underlying database changes.
- Room - Access your app's SQLite database with in-app objects and compile-time checks.
- ViewModel - Store UI-related data that isn't destroyed on app rotations. Easily schedule asynchronous tasks for optimal execution.
- Dagger2 - A compile-time framework for dependency injection.
- Moshi - A modern JSON library for Android and Java. It makes it easy to parse JSON into Java objects.
- Retrofit2 - A type-safe HTTP client for Android and Java.
- RxJava2 - A Java VM implementation of Reactive Extensions: a library for composing asynchronous and event-based programs by using observable sequences.
- Coil - An image loading library for Android backed by Kotlin Coroutines.
- Lottie - A mobile library for Android and iOS that parses Adobe After Effects animations exported as json with Bodymovin and renders them natively on mobile.
- Shimmer Facebook - An Android library that provides an easy way to add a shimmer effect to any view in your Android app.
- Intuit Sdp - An android SDK that provides a new size unit - sdp (scalable dp). This size unit scales with the screen size. It can help Android developers with supporting multiple screens.
- Intuit Ssp - An android SDK that provides a new size unit - ssp (scalable sp). This size unit scales with the screen size based on the sp size unit (for texts). It can help Android developers with supporting multiple screens.
- Timber - This is a logger with a small, extensible API which provides utility on top of Android's normal Log class.
- SQLCipher - Android SQLite API based on SQLCipher.
Check out these pages to learn more about Clean Architecture:
Please use this as a reference only. Hope this helps you develop more projects.
Copyright (C) 2020 Alfa Centaury Hidayatullah
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.