Giter Club home page Giter Club logo

mr-lonewolfer / interviewtask Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 125.83 MB

This project is an Android application developed for an interview task. It fetches media coverages from a remote service and displays them in a paginated list. The app utilizes modern Android development practices and libraries such as Retrofit for network operations, Dagger Hilt for dependency injection, and Paging 3 for pagination.-By NimeshPatel

Kotlin 100.00%
dagger2 dependency-injection hilt-android imagecaching jetpack-android kotlin-android lrucache memorycache mvvm mvvm-android mvvm-architecture mvvm-pattern retrofit2 storage-management

interviewtask's Introduction

MVVM Hilt

Overview

This project is an Android application developed for an interview task. It fetches media coverages from a remote service and displays them in a paginated list. The app utilizes modern Android development practices and libraries such as Retrofit for network operations, Dagger Hilt for dependency injection, and Paging 3 for pagination.

Development Environment

  • IDE: Android Studio Iguana | 2023.2.1 Patch 2
  • Gradle Version: 8.4
  • Android Gradle Plugin Version: 8.3.2
  • Compile SDK: 34
  • Min SDK: 24
  • Target SDK: 34

Installation

To build and run the project locally, follow these steps:

  1. Clone the repository to your local machine.
  2. Open the project in Android Studio.
  3. Build the project using the provided Gradle configuration.

Dependencies

The project uses several third-party libraries for various functionalities. Here are the main dependencies:

  • Retrofit: For making network requests.
  • Dagger Hilt: For dependency injection.
  • Paging 3: For pagination of media coverages.
  • Coroutines: For asynchronous programming.
  • AndroidX Libraries: Including LiveData, ViewModel, RecyclerView, etc.
  • Other: sdp & ssp Libraries used for maintaining resolution across different screen sizes.

For a detailed list of dependencies and versions, refer to the build.gradle file in the project.

Features

  • Media Coverage Display: Fetches media coverages from a remote service and displays them in a paginated list.
  • Image Loading and Caching: Implements image loading and caching mechanism using a combination of LruCache and memory cache. It provides informative error messages or placeholders for failed image loads.
  • Error Handling: Provides error handling for failed image loads, ensuring a smooth user experience.
  • Dependency Injection: Utilizes Dagger Hilt for dependency injection to manage dependencies efficiently.
  • No Third-Party Libraries: Implements image loading and caching mechanism without relying on any third-party libraries.

Image Loading and Caching

The application follows the following approach for image loading and caching:

  1. Check Cache Memory: It first checks if the image is available in the cache memory. If found, it directly loads the image from the cache.
  2. Local Path: If the image is not available in the cache memory, it checks if a local path for the image is available. If found, it loads the image from the local path.
  3. URL: If the image is not available in the cache memory or through a local path, it fetches the image from the provided URL.

Usage

The app primarily consists of the following components:

  • MediaCoverageRepository: Responsible for fetching media coverages from the remote service.
  • MediaCoverageViewModel: Manages the UI-related data and interactions, including permission status and media coverages data.
  • MediaCoverageAdapter: Adapts the media coverages data for display in a RecyclerView.
  • SquareGridRecyclerView: A custom RecyclerView implementation for displaying items in a grid layout with square aspect ratio.

App UI GIF

Watch the App UI video

Download APK

interviewtask's People

Contributors

mrlonewolfer avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.