The application in clean architecture and MVVM presentation archticture

Related tags

App BestAndroidDemo
Overview

Mobile Assignment CS

I have built this application in clean architecture and MVVM presentation archticture. It's well tested and documented for all layers data, domain, and presentation.

How to build it on your environment?

For secutity wise, I have hidden my API key from the project and added it in local.properties
In order to build the project properly in your machince, you have to add your The Movie DB's API key in your local.properties file.

API_KEY="YOUR_API_KEY"

App architecture

alt text

Decisions

  • Used TDD approach while implementing the project
  • Implemented 2 extra gradle files to organize dependencies versions and groups.
  • Implemented Detct tool to make static analysis and generates reports in /app/build/reports/detekt/detekt.html
  • Created gradle task to read my API key from local.properties -Created two build varients one for release and second for debug to see http logs
  • Implemented mappers to map data between the layers
  • Provided error handling in data layer to detect 2 kinds of errors
    • Server Error : it happens if the server is not responded
    • Data Error : if there is an error in the response
  • Provided error handling for presentationlayer through modelView, it acts as a state with
    • isLoading : to show progressbar while data is laoding
    • errorMessage : to show the error message that happened in the data layer
    • isEmpty : to show that data is empty and there no thing to be shown
    • object data : that's the real data that would be shown
  • Used Either concept to perform these error handlings
  • Created separated packages and modules to avoid coupling issue and achieve the Separation of Concerns (SOC) concept
    • Core package that contains some base and common classes, DI, failure exceptions, and retrofit interceptor
    • Features package that contains the clean architecture layers (data - domain - presentation) for each screen
  • Used LivDataUtilTest to await the still get the observed data in testing
  • Used Mockk for mocking data
  • Used Truth for testing assertions
  • Used Glide to do caching of loaded images and verified if there is no photo collected, it shows not_found placeholder image
  • Used coroutine and flow to use dispatchers for calling endpoints and emit data to other layers and created it in baseUseCase
  • Used view binding and data binding to update the views like bindingPosterUrl
  • Created animated and custmized RatingView using basic RectF and paints
  • Implemented some styles to make it easier to use them in header, and title text..etc
  • Used android chips to publish genres in details screen
  • Used the excat fonts that used in the design which are helveticaneuelt and helveticaneuelt bold
  • I have created some branches in gitlab for each feature and merge each one into develop branch

Assumptions

  • I couldn't extract icons in SVG files so I did web inspections to get the logo and also I used extrnal back button icon
  • In popular endpoint, there is no attribute for movie duration, So I ignored it
  • I tried to follow the deign as much as possiple but there are some missing stuff

Liberaries

  • Jetpack
    • Viewmodel - Manage UI related data in a lifecycle conscious way and act as a channel between use cases and UI.
    • Data Binding - support library that allows binding of UI components in layouts to data sources, binds character details and search results to UI.
    • LiveData - Provides an observable data holder class.
    • Navigation - navigates between fragments
  • Retrofit - type safe http client and supports coroutines out of the box.
  • Moshi - 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.
  • kotlinx.coroutines - Library Support for coroutines. I used this for asynchronous programming in order to obtain data from the network as well as the database.
  • materialDesign - Use some stuff from material design like Chips
  • glide - display and cache loaded images
  • paginator - add pagination to recyclerview
  • Hilt - Dependency injection plays a central role in the architectural pattern used. For this reason I have chosen Hilt which is built on top of the battle tested DI framework - Dagger 2.
  • JUnit - This was used for unit testing the repository, the use cases and the ViewModels.
  • Mockk This is a mocking library for Kotlin. I used it to provide test doubles during testing.
  • Truth - Assertions Library, provides readability as far as assertions are concerned.
  • Robolectric - Unit test on android framework.
  • detek - static analysis tool.
You might also like...
An android app built using Kotlin following Multi-Module Clean Architecture MVVM
An android app built using Kotlin following Multi-Module Clean Architecture MVVM

Notflix 🛠️ Work In Progress 🛠 An android app built using Kotlin that consumes TMDB API to display current trending, upcoming and popular movies 🍿 a

A weather app for Android using OpenWeatherMap with MVVM + Clean Architecture

Weather App 🌤 Weather App for Android that shows 16 days forecast for Paris, France - Made with Hilt, Coroutines, Retrofit, ViewModel, Navigation bas

NewsApp - Modern Minimalistic Design, MVVM, Pagination, Retrofit, Coroutines, Room, Glide, Navigation Component (Clean Architecture)
NewsApp - Modern Minimalistic Design, MVVM, Pagination, Retrofit, Coroutines, Room, Glide, Navigation Component (Clean Architecture)

NewsApp is a modern news android application which features virtually ALL recent and recommended android development tech stack and tools used

A Mars Photos app for Android using NASA APIs with MVVM + Clean Architecture

Mars Photos App 🚀 Mars Photos App for Android that display a list of photos taken from cameras from different rovers - Made with Hilt, Coroutines, Re

A wallpaper app Built with MVVM clean architecture using pixabay api
A wallpaper app Built with MVVM clean architecture using pixabay api

wallpaper get your API key at pixabay in order to test the APP! This project demonstrates the use of jetpack compose and modularization. it is complet

Easy Note: Building a Notes app using MVVM, JetPack Compose with a clean multi-module architecture approach.
Easy Note: Building a Notes app using MVVM, JetPack Compose with a clean multi-module architecture approach.

Easy Note Easy Note: Notes app using JetPack Compose and MVVM with a clean architecture approach. This app shows the usage of the new Navigation Archi

Android Clean Architecture Kick Start project with MVVM, Coroutine, DI, Caching, Networking.

Android Clean Architecture Kick Start project with MVVM, Coroutine, DI, Caching, Networking Stacks: Clean Architecture MVVVM Local Caching (StoreX) Ne

PopularMovieApp - A simple project to Chiper challenge taken data from The Movie DB based on Kotlin MVVM clean architecture
PopularMovieApp - A simple project to Chiper challenge taken data from The Movie DB based on Kotlin MVVM clean architecture

A simple project to Chiper challenge taken data from The Movie DB based on Kotli

Quote-App-Kotlin - Quote App Based on MVVM clean architecture getting quote from json file stored in assets

Quotify - Simple Quotes App This app shows the use of ViewModel and ViewModelFac

Owner
Mohamed Hashim
Mohamed Hashim
UIPresenter library for android view-based UI presentation

UIPresenter This android library is like a tour guide for your app's Views. It h

Germain Kevin 21 Sep 21, 2022
Weather application example with Android Architecture components and Clean Architecture

Weather application example with Android Architecture components and Clean Architecture Weather app that shows how to architect an android app in a cl

null 2 Dec 3, 2021
A movies application built Using clean architecture and MVVM (Model-view-viewModel).

Movies-App This is a movies application which fecthes upcoming and popular movies from the movie Database(TMBD). It is built Using clean architecture

Felix Kariuki 4 Dec 20, 2022
Food Recipes - Android application built with Jetpack compose, MVVM and clean architecture approach.

Food Recipes Android application that consuming (https://spoonacular.com/food-api) "Recipes api". It has been built with clean architecture principles

Mahmoud Elshahat 26 Jan 29, 2023
MVVM News Application with clean code architecture & android jetpack components.

Android - Clean Architecture - Kotlin The purpose of this repo is to follow up Clean Architecture principles by bringing them to Android. The repo con

Rafsan Ahmad 38 Aug 8, 2022
The Rick And Morty - MVVM with a clean architecture approach using some of the best practices in Android Development.

Rick-and-Morty The Rick And Morty - App consuming a Rick and Morty API to display Characters it has been built with clean architecture principles, Rep

Akhilesh Patil 61 Jan 7, 2023
A GitHub user Android apps using Dagger 2, MVVM, Modularization, Clean Architecture, and Airbnb Epoxy

A GitHub user Android apps using Dagger 2, MVVM, Modularization, Clean Architecture, and Airbnb Epoxy.

Alva Yonara Puramandya 3 Dec 28, 2022
Dose a Android app that reminds you medications exactly when your body needs them, building entirely using Kotlin and Jetpack Compose with MVVM + Clean Architecture

??⏰ Dose is a work-in-progress Android app that reminds you medications exactly when your body needs them, building entirely using Kotlin and Jetpack Compose with MVVM + Clean Architecture

Waseef Akhtar 195 Jan 1, 2023
Simple Android movies app using MVVM clean architecture.

Simple Android movies app using MVVM clean architecture.

Marcos Calvo García 57 Dec 30, 2022