Skip to content

Android Giphy search api using Dagger2, Coroutine, Retrofit, Navigation Component, Paging 3.0, Junit Jetpack (Room, ViewModel, LiveData) based on MVVM with clean architecture.

Notifications You must be signed in to change notification settings

mookyjan/giphySearchCleanArch

Repository files navigation

Giphy-App

Important

There are two branches for this project

  1. Develop -> In this branch api is call only once data is loaded and user can search and make favourite/ UnFavourite
  2. develop_pagination -> this branch have additional setup for pagination so user can scroll unlimited number of gifs

Note: UI is not very good the more focus was on the functionality.

Structure of the code

Simple Android Application written in Kotlin. This project follows Clean Architecture with MVVM with Clean Architecture Design

Project consist of One Activity and Two Fragments

  1. Home Fragment -> When use launch the app Trending list of Gif is shown , there is search option for the user when user enter any search query based on it the latest result will be shown to it.
  2. Favourite Fragment -> In this screen user can see their favourites GiF, can add and remove the Gif from list.

Main libraries used

  • Kotlin - First class and official programming language for Android development.
  • Kotlin Coroutine - For asynchronous and more..
  • Android Architecture Components - Collection of libraries that help you design robust, testable, and maintainable apps.
    • LiveData - Data objects that notify views when the underlying database changes.
    • ViewModel - Stores UI-related data that isn't destroyed on UI changes.
    • ViewBinding - Generates a binding class for each XML layout file present in that module and allows you to more easily write code that interacts with views.
    • Navigation Component - Used it for the navigation from one fragment to another fragments
    • Room -Used for local data storage
    • Paging 3.0 -to load large amount of data in chunks instead to load all the records in one api call. Paging 3.0 will automatically call the api to laod more data when user reached to end of the screen.
  • Dependency Injection
    • Dagger2 - Standard library to incorporate Dagger dependency injection into an Android application.
  • Retrofit - A type-safe HTTP client for Android and Java.
  • Glide - Used for loading images
  • Material Components for Android - Modular and customizable Material Design UI components for Android.
  • Timber -Used for loggging
  • Junit - For Unit Testing
  • Mockk - For mocking in Unit Testing

Architecture Design

alt text

alt text

alt text

Modules

  • core/ : contains the common functions
  • data/ : contains the code to access to the data (repository pattern)
  • domain/ : contains the business logic and the usecases
  • app : Presentation layer, contains the UI

this project consist of Two screen. on the first screen showing the list of movies list and on clicking the item go to the details of the movie. Swipe to Refresh can be used to refresh data and when user scroll new list of movies will be automatically and for the simplicity of this project many things have been kept simple like

  • ErrorHandling,
  • Internet connectivity and
  • Design of the app is also kept sample and can be improved much more

comments are written with the function that what it will do.

also TODO are given in the area which we can improve more.

Screenshots

alt text

alt text

alt text

alt text

alt text

alt text

alt text

alt text

alt text

alt text

alt text

TODO

need to make offline mode fist app

adding more unit test cases

setup for CI/CD

improving the design

Releases

No releases published

Packages

No packages published

Languages