An android app built using Kotlin that consumes TMDB API to display current trending, upcoming and popular movies 🍿 .

Overview

Flick

An android app built using Kotlin that consumes TMDB API to display current trending, upcoming and popular movies 🍿 .It has been built following Clean Architecture Principle, Repository Pattern, MVVM Architecture in the presentation layer as well as Jetpack components.

Table Of Content.

So let's get started ...

Architecture.

What is Clean Architecture?

Clean architecture was proposed by Robert C. Martin in 2012 in the Clean Code Blog and it follows the SOLID principles.

Clean Architecture Diagram

The circles represent different layers of your app. Note that:

  • The center circle is the most abstract, and the outer circle is the most concrete. This is called the Abstraction Principle. The Abstraction Principle specifies that inner circles should contain business logic, and outer circles should contain implementation details. The outer circles are mechanisms while the inner circles are policies.

  • Another principle of Clean Architecture is the Dependency Rule. This rule specifies that each circle can depend only on the nearest inward circle ie. low-level modules do not depend on high-level modules but the other way around.

Why Clean Architecture?

  • Loose coupling between the code - The code can easily be modified without affecting any or a large part of the app's codebase thus easier to scale the application later on.
  • Easier to test code.
  • Separation of Concern - Different modules have specific responsibilities making it easier for modification and maintenance.

Layers.

1. Domain.

This is the core layer of the application. The domain layer is independent of any other layers thus ] domain models and business logic can be independent from other layers.This means that changes in other layers will have no effect on domain layer eg. screen UI (presentation layer) or changing database (data layer) will not result in any code change withing domain layer.

Components of domain layer include:

  • Models: Defines the core structure of the data that will be used within the application.

  • Repositories: Interfaces used by the use cases. Implemented in the data layer.

  • Use cases/Interactors: They enclose a single action, like getting data from a database or posting to a service. They use the repositories to resolve the action they are supposed to do. They usually override the operator “invoke”, so they can be called as a function.

2. Data.

The data layer is responsibile for selecting the proper data source for the domain layer. It contains the implementations of the repositories declared in the domain layer.

Components of data layer include:

  • Models

    -Dto Models: Defines POJO of network responses.

    -Entity Models: Defines the schema of SQLite database.

  • Repositories: Responsible for exposing data to the domain layer.

  • Mappers: They perform data transformation between domain, dto and entity models.

  • Network: This is responsible for performing network operations eg. defining API endpoints using Retrofit.

  • Cache: This is responsible for performing caching operations using Room.

  • Data Source: Responsible for deciding which data source (network or cache) will be used when fetching data.

3. Presentation.

The presentation layer contains components involved in showing information to the user. The main part of this layer are the views(activity and fragments) and viewmodels.

Tech Stack.

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

Libraries.

  • Koin - Dependency Injection library.

  • Jetpack

    • Android KTX - Provide concise, idiomatic Kotlin to Jetpack and Android platform APIs.
    • AndroidX - Major improvement to the original Android Support Library, which is no longer maintained.
    • Lifecycle - Perform actions in response to a change in the lifecycle status of another component, such as activities and fragments.
    • LiveData - Lifecycle-aware, meaning it respects the lifecycle of other app components, such as activities, fragments, or services.
    • ViewModel - Designed to store and manage UI-related data in a lifecycle conscious way. The ViewModel class allows data to survive configuration changes such as screen rotations.
    • Data Binding - Allows you to bind UI components in your layouts to data sources in your app using a declarative format rather than programmatically.
    • Room - Provides an abstraction layer over SQLite used for offline data caching.
    • Navigation Component-Component that allows easier implementation of navigation from simple button clicks to more complex patterns.
  • MotionLayout - Helps create and manage beautiful UI animations.

  • Retrofit - Type-safe http client and supports coroutines out of the box.

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

  • OkHttp-Logging-Interceptor - Logs HTTP request and response data.

  • Coroutines - Library Support for coroutines.

  • Flow - Flows are built on top of coroutines and can provide multiple values. A flow is conceptually a stream of data that can be computed asynchronously.

  • Material Design - Build awesome beautiful UIs.

  • kotlinx.coroutines - Library Support for coroutines,provides runBlocking coroutine builder used in tests.

  • Truth - Assertions Library,provides readability as far as assertions are concerned.

  • Mockito - Mocking framework for tests.

Extras

  • GitHub Actions - GitHub actions is used in this project to check for syntax correctness using linting when pushing changes to the dev branch or when making a pull request to the main branch.

Helpful Resources

In this section i've included some resources ie. articles and GitHub repositories that are helpful when learning about clean architecture:

  1. The clean code blog by Robert C. Martin.
  2. A detailed guide on developing android apps using clean architecture pattern Medium article.
  3. Clean Architecture Component Boilerplater GitHub repo .
  4. The Force GitHub repo by David Odari demonstrating using clean architecture pattern
  5. Clean architecture tutorial for android article by Raywenderlich which is really beginner friendly.

Screenshots

These are the app's screenshots:

You might also like...
This is a Movie API app in which data is fetched online from the TMDB site using API authentication.

Movie-API This is a Movie API app in which data is fetched online from the TMDB site using API authentication. MVVM model is used for Database Managme

Movie streaming is an android app that show us last,newest,top imdb and popular movies.
Movie streaming is an android app that show us last,newest,top imdb and popular movies.

Movies-Streaming-Android-App An Android application which shows Popular, New Movies, Top Rated movies and all the details of any movie like- Cast, Rev

Movie Info - MovieInfo app that recieves popular movies and allow the user to search for specific movie through the restapi
Movie Info - MovieInfo app that recieves popular movies and allow the user to search for specific movie through the restapi

Movie_Info MovieInfo app that recieves popular movies and allow the user to sear

A reliable android app that shows upcoming fixtures, updated league tables, and top goal scorers in a Premier League and French Ligue 1
A reliable android app that shows upcoming fixtures, updated league tables, and top goal scorers in a Premier League and French Ligue 1

RapidScore Screenshots Table of Contents Description Dependencies API Reference Lessons Learnt Contributing Roadmap Google Playstore License Author In

Popular Movies showcase android app
Popular Movies showcase android app

Pop Flix PopFlix is a gorgeous client application for TMDb on Android, built using Kotlin. Architecture and Tech-stack Built on MVVM architecture patt

An advanced Kotlin (Android Native) application that uses SOLID architectural principles, consumes a RESTFUL Service, downloads & images using best practices
An advanced Kotlin (Android Native) application that uses SOLID architectural principles, consumes a RESTFUL Service, downloads & images using best practices

Dog-Playground Kotlin An advanced Kotlin (Android Native) application that uses SOLID architectural principles, consumes a RESTFUL Service, downloads

Keep track of popular & top rated movies and see movie details

Movies Keep track of popular & top rated movies and see movie details Features Keep track of popular & top rated movies See movie details Libraries Je

Movie listing app using Jetpack Compose and Tmdb api
Movie listing app using Jetpack Compose and Tmdb api

Jetflix A Movie listing app using TheMovieDb api and Jetpack Compose. Based on MVVM architecture with Dagger Hilt. Screenshots Download Go to Releases

PNPscript - ProdigyPNP's upcoming programming language, designed for hacking Prodigy.

PNPscript PNPscript - ProdigyPNP's upcoming programming language, designed for hacking Prodigy. THIS IS IN EARLY DEVELOPMENT. DON'T BOTHER TRYING TO A

Owner
Kagiri Charles
Android Developer
Kagiri Charles
Top trending movies app for Android

Flickwatcher Flickwatcher for Android lets you see today's latest trending movies! Cool Dependencies: Jetpack Compose Accompanist-Coil Kotlin Coroutin

Evan W. Isnor 5 May 16, 2022
Simple android application that consumes RAWG API to display a list of games

Gamex Compose -Work in Progress- An android application that consumes RAWG API to display a list of popular video games built using Jetpack Compose an

Victor Kabata 17 Nov 14, 2022
TMDbHub - Listing movies using the TMDb API. You can filter results, view details, and save them to a collection

TMDb Hub Listing movies using the TMDb API. You can filter results, view details

David Varga 4 Dec 30, 2021
Mobile app to Show Movies From TMDB API [Qhala Interview Solution], for the Android Engineer Role

Qhala Interview ?? ?? This is an Interview Tech challenge by Qhala I used TMDB API to solve this challenge. Screenshots Movies Movie Detail Prerequisi

James Nyakundi 5 May 1, 2022
MovieLibrary -An android application which uses tmdb API to fetch the data for various movies and TV Shows

MovieLibrary -An android application which uses tmdb API to fetch the data for various movies and TV Shows

null 1 May 1, 2022
New version of my Android app that shows you popular movies using themoviedb.org API.

New version of my Android app that shows you popular movies using themoviedb.org API. Using Modern Android Develpment skills like Kotlin, Room, Retrofit, Hilt, coroutines, Flow and Jetpack Compose.

Gemma Lara Savill 0 Apr 21, 2022
This project shows trending github repositories using MVI (Model View Intent) using kotlin flows and multi module clean architecture

GithubTrendingMVIFlow Build Architecture: This project shows trending github repositories using MVI (Model View Intent) using kotlin flows and multi m

Zulqurnain Haider 0 Jun 2, 2022
Android app which fetches a sample movies list to display. Built using Kotlin and latest Android tech stack, with an approach to clean architecture.

movies-sample-app This is an Android app which fetches a sample movies list to display. Built using Kotlin and latest Android tech stack, with an appr

Nadeem Ahmed 1 Oct 21, 2021
The App Loads list of popular movies from a mock API and shows in a recyclerView

popular-movies-app About The App Loads list of popular movies from a mock API and shows in a recyclerView. Any item can be clicked to open the Movie D

Mayank Agarwal 0 Oct 30, 2021
App uses the TMDB in order to provide a list of movies, artists and TV shows

MoviesAppTMDB This app uses the TMDB in order to provide a list of movies, artists and TV shows. The purpose of this app is to demonstrate the use of

null 0 Nov 4, 2021