Example of combination recommended by Google libraries

Overview
  • Project description

This project includes several widely used libraries and shows how to deal with them in connection.

Project created as multilayer project with domain, presentation and repository layer. Why different layers:

  1. We can split the logic of the app
  2. We can do tasks of the same feature in parallel
  3. We can unbind network and presentation layers
  4. Code became more testable
  5. Different layers can be put in separate modules
  6. Easier to inject objects

Project uses Hilt as dependency injection tool. Why Hilt:

  1. Recommended by Google
  2. Extension of well-known Dagger
  3. Easier in testing
  4. Can catch errors on build step

Project uses navigation for transitions between the fragments. Why navigation:

  1. Easier way to manage transitions between fragments
  2. Easier way to pass parameters between fragments
  3. More predictable behavior base on visualization
  4. Navigation controller can be found in any place(for example it's possible to navigate from the ViewModel)

Project uses Coil for image presentation. Why Coil:

  1. Written on Kotlin and based on coroutines
  2. Adds to final build less methods
  3. Takes care about caching of images
  4. Has reach image-transformation possibilities and another functionality

To provide access to the view inside fragments and activity was used view binding. Why view binding:

  1. Easy to get access to any view
  2. Works faster then findViewById()
  3. Reducing the number of internal variables inside classes

All this allow me to create clean and transparent code where easy to find any logic and write tests for any part of code. Click event flow implemented with custom solution, probably already exist recommended way (needs to be investigated). Couple of places still have to be changed:

  1. Not implemented possibility to put in DiffUtils parameter to sort items in the list.
  2. Not finished instrumentation tests to check network use-cases and some UI use-cases.
  3. Would be nice to scroll to last clicked position after user returns from details fragments.
Comments
  • Implementation of presentation layer

    Implementation of presentation layer

    1. I've used the MVVM design pattern here. It allows not to care about screen rotation.
    2. As I decided at the beginning of this task I implemented pagination with Diffutils. It helps to simplify the process of sorting in the future. Also, the paging library takes care of items updates and does network requests in corresponded time. In reality, it would be nice to cache loaded data to the DB witch is also supported by the Paging library.
    3. Navigation makes the transition between fragments easier. It's clear how to pass data from one to another. I would implement a mechanism of a scrolling list of items to the last clicked item after the user comes back from the details fragment. It's also can be done with navigation.
    4. It was not enough time to finish the instrumentation tests but I can finish them a bit later.
    opened by denist2001 0
  • Repository layer is ready for use.

    Repository layer is ready for use.

    I've used Retrofit as the basement of network interactions. Pagination takes care of updating from the network. Added Mockk library for unit test purposes. Coroutines moved to the test thread with Jetbrains's library.

    opened by denist2001 0
  • Domain layer convert data from repository data model to presentation data layer

    Domain layer convert data from repository data model to presentation data layer

    As we have a possibility to get items one by one, we can reduce traffic for the user by requesting only the needed number of items. For this purpose, I want to use Pagination. It helps me to postpone this work(control of updates and getting new items) to external library. This commit prepare network and presentation data models for upcoming conversion from one layer to another.

    opened by denist2001 0
  • Apps layers was created.

    Apps layers was created.

    Why different layers:

    1. We can split the logic of the app
    2. We can do tasks of the same feature in parallel
    3. We can unbind network and presentation layers
    4. Code became more testable
    5. Different layers can be put in separate modules
    6. Easier to inject objects
    opened by denist2001 0
  • Task/add navigation tree

    Task/add navigation tree

    Why navigation:

    1. Easier way to manage transitions between fragments
    2. Easier way to pass parameters between fragments
    3. More predictable behavior base on visualization
    4. Navigation controller can be found in any place(for example it's possible to navigate from the ViewModel)
    opened by denist2001 0
Owner
Denis
Denis
Displays a list of albums using latest libraries

Albums Application Demo Displays a list of albums using latest libraries Used Clean Architecture #Domain: Contains the definitions of the business log

null 0 Nov 3, 2021
This is an example implementation of android accessibility services with 5 Sample Actions

Android Accessibility Services Example This is an example implementation of android accessibility services with 5 Sample Actions such as: Simulate Pow

Muhammad Fahriansyah 7 Jul 1, 2022
This is an example repository to demonstrate the good practices of using ViewModel and how usage of AndroidViewModel can make things worst in a codebase

ViewModel Good Practices ??‍♂️ This is a example repository to demonstrate the good practices of using ViewModel and how usage of AndroidViewModel can

Shreyas Patil 29 Sep 28, 2022
📌This repo contains the kotlin implementation of TensorflowLite Example Android Apps🚀

TensorflowLite Examples Kotlin This repo contains the kotlin implementation of TensorflowLite Example Apps here, which are mostly implemented in java

Sunit Roy 29 Jan 1, 2023
Example Android library project that works with jitpack.io

android-example Example Android library project that works with jitpack.io. See this Tutorial on how to publish an Android Library with JitPack. For m

Denys Denysenko 0 Dec 20, 2021
This example was built for lecturing proposes, it shows how to consume data from an API.

Android Kotlin NewsMobEDJDCM2122 Example - EDJD 2021/2022 This example was wirten during the Mobile Computing lectures in the course 'Lincentura em En

null 0 Nov 8, 2021
An example to show how a proper plugin for Lambda Client is set up

Lambda Plugin SDK This project in an example to show how a proper plugin for Lambda Client is set up. The advantage of plugins for a utility mod is th

KMatias 0 Oct 25, 2021
An example Android Application to test out Kotlin development in Adndroid

AndroidDiceGenerator This is an example Android Application to test out Kotlin development in Adndroid. On pressing a button, the application generate

Fredrick Ojure 0 Oct 28, 2021
Its a small example with Custom Employee object is sent from one Fragment to another.

Kotlin-SafeArgs-Custom-Object Its a small example with Custom Employee object is sent from one Fragment to another. Dependencies used // Navigation

Akshay Teli 0 Oct 30, 2021
ROOM Database Example with MVVM in Kotlin[Fragments,Navigation]

RoomDatabase_SampleApp Room Database Sample App Overview Of This Room Database Application In this app, we can do operation on room database | Insert,

RUHUL AMIN CHOUDHURY 0 Nov 3, 2021
ListView Example with custom Adapter Using Kotlin in Android Studio

Kotlin-ListView ListView Example with custom Adapter Using Kotlin in Android Studio Steps to follow : Build ListView with Custom Adapter in Kotlin Add

null 0 Nov 5, 2021
This application is an example of how to create menu on android platform.

HW_Menu This application is an example of how to create menu on android platform. Table of Contents Introduction Screenshots Resources Contact Introdu

Ibrahim Alfaifi 0 Nov 9, 2021
Spring Native Bookcase Backend Example

Spring Native Bookcase Backend Example Simple example for bookcase backend. Saves bookcases and list them (simple CRUD). set database connection prope

lesestunden.de 1 Dec 7, 2021
Learn How to use Google Map API for Android from Basic to Advance with complete examples.

Complete-Google-Map-API-Tutorial Learn How to use Google Map API for Android from Basic to Advance. Satellite View 3D Building Map and StreetView Lear

Next 117 Dec 8, 2022
A Google coding competitions practice preparing to the hashcode competition

One Pizza This is a Google coding competitions practice preparing to the hashcode competition.

Anthony P. 1 Feb 22, 2022
PolitcalPreparedness is an example application built to demonstrate core Android Development skills recommended by Google.

PolitcalPreparedness is an example application built to demonstrate core Android Development skills recommended by Google.

Pranav Patel 1 Apr 13, 2022
Combination of a beautiful clock with widget, alarm, stopwatch & timer, no ads

Simple Clock The app has multiple functions related to timing. At the clock you can enable displaying times from other timezones, or use the simple, b

Simple Mobile Tools 462 Dec 28, 2022
Demo app demonstrating how to create and manage notifications locally using a combination of Jetpacks Worker Manager and Broadcast Receiver.

Worker Notification Demo app demonstrating how to create and manage notifications locally using a combination of Jetpacks Worker Manager and Broadcast

Ayia 1 Sep 19, 2022
:movie_camera: Movie discovery app showcasing Android best practices with Google's recommended architecture: MVVM + Repository + Offline support + Android Architecture Components + Paging library & Retrofit2.

Popular Movies Stage 1 + Stage 2 Discover the most popular and top rated movies playing. Movies data fetched using themoviedb.org API. ✨ Screenshots M

Yassin AJDI 189 Nov 26, 2022
DSC Moi University session on using Navigation components to simplify creating navigation flow in our apps to use best practices recommended by the Google Android Team

Navigation Components Navigate between destination using safe args How to use the navigation graph and editor How send data between destinations Demo

Breens Mbaka 6 Feb 3, 2022