An Android app consuming Pixabay API to search and display list of images, built with MVVM pattern

Overview

Images

An Android app consuming Pixabay API to search and display list of images, built with MVVM pattern as well as Architecture Components.

Min Api Level: 23

Build System : Gradle

Table of Contents

Prerequisite

This project uses the Gradle build system. To build this project, use the gradlew build command or use "Import Project" in Android Studio.

App

The app loads the the images from the api based on search query and displays them in a list. It also has Room DB for local cache. When the Image is clicked, a dialog is shown and upon positive user input the app navigates to the Details fragment which shows a bigger picture.

Architecture

The app is built using the Modular MVVM architectural pattern and makes heavy use of a couple of Android Jetpack components. MVVM allows for the separation of concern which also makes testing easier. The app has a fragment that communicates to ViewModel which in turn communicates to the usecase which communiacates to Repository to get data.

Testing

With MVVM testing is made easier in that Ui can be tested separately from the business logic. Mocking the ViewModel to test the fragment for user interaction using espresso, mocking the repository to test the ViewModel with Junit as well as mocking the API service/dao to test the repository using the Junit. The App has tests on Fragments as well as Paging test under the Android Test packages in respective modules.

Libraries

Libraries used in the whole application are:

  • Jetpack 🚀
    • Viewmodel - Manage UI related data in a lifecycle conscious way
    • Data Binding - support library that allows binding of UI components in layouts to data sources, binds search results to UI
    • Room - Provides abstraction layer over SQLite used for cache
    • Paging 3 used for paging
  • Retrofit - Type-safe HTTP client and supports coroutines out of the box. Used for the network calls.
  • Gson - Used to convert JSON to Java/Kotlin classes for the Retrofit
  • okhttp-logging-interceptor - logs HTTP request and response data.
  • kotlinx.coroutines - Library Support for coroutines
  • Hilt - Used for Dependency injection
  • Glide - Allows for fetching and displaying of images to imageviews

Screenshots

You might also like...
 A program written entirely in Kotlin using the principles of Clean Architecture according to the MVVM pattern
A program written entirely in Kotlin using the principles of Clean Architecture according to the MVVM pattern

A program written entirely in Kotlin using the principles of Clean Architecture according to the MVVM pattern. An application that shows a list of ani

A podcast proxy that sits between itunes search api and android apps allowing normalization of rss feeds to standard Json format that can be consumed by apps.

Podcasts Rss Feeds Search Proxy A podcast proxy written using kotlin dsl that sits between itunes search api, podcasts rss feeds and android apps allo

Kotlin app that shows a list of characters using the api SWAPI
Kotlin app that shows a list of characters using the api SWAPI

StarWarsCharacters Kotlin app that shows a list of characters using the api SWAPI (https://swapi.dev) This is a clean architecture app example built w

Accounting-App - An Android app built with Kotlin, Material, Jetpack Compose, Hilt, Room, Coroutines, Data-Store, MVVM-Clean Architecture and JUnit tests BooksApp - Show the books list from an API with using retrofit2, picasso and JSON libraries
BooksApp - Show the books list from an API with using retrofit2, picasso and JSON libraries

BooksApp Books App Show the books list from an API with using retrofit2, picasso

Kotlin microservices with REST, and gRPC using BFF pattern. This repository contains backend services. Everything is dockerized and ready to
Kotlin microservices with REST, and gRPC using BFF pattern. This repository contains backend services. Everything is dockerized and ready to "Go" actually "Kotlin" :-)

Microservices Kotlin gRPC Deployed in EC2, Check it out! This repo contains microservices written in Kotlin with BFF pattern for performing CRUD opera

Simple Todo list API using Spring-Boot, Webflux, Kotlin, Coroutines, & PostgreSQL

Simple Todo list API using Spring-Boot, Webflux, Kotlin, Coroutines, & PostgreSQL

Search image app [Adanian Labs Interview], Android developer role
Search image app [Adanian Labs Interview], Android developer role

Pixar This is App shows you Images from the Pixabay API Table of Contents Functionalities Approach Screenshots How To Setup Libraries Used Author Info

Demonstration of Object Pool Design Pattern using Kotlin language and Coroutine
Demonstration of Object Pool Design Pattern using Kotlin language and Coroutine

Object Pool Design Pattern with Kotlin Demonstration of Thread Safe Object Pool Design Pattern using Kotlin language and Coroutine. Abstract The objec

Owner
Ronnie Otieno
Android - Kotlin/Java. Learning more. Also Google certified AAD.
Ronnie Otieno
A fake shopping app built using the MVVM archirecture consuming FAKE STORE API

FakeStore A fake shopping app built using the MVVM archirecture consuming FAKE STORE API N/B This API does not provide an endpoint for registering use

marsden madoka 4 Aug 17, 2022
FirestoreCleanArchitectureApp is an app built with Kotlin and Firestore that displays data in real-time using the MVVM Architecture Pattern. For the UI it uses Jetpack Compose, Android's modern toolkit for building native UI.

FirestoreCleanArchitectureApp FirestoreCleanArchitectureApp is an app built with Kotlin and Cloud Firestore that displays data in real-time using Andr

Alex 66 Dec 15, 2022
Anime-Info-Search-Jikan - Search Information about Anime

Anime-Info-Search-Jikan Search Information about Anime. Home Page Information Pa

null 3 Nov 13, 2022
A movie & TV show exploration app that implements MVVM design pattern by following the clean architecture principles, using TMDB API.

?? Movie App ?? A movie & TV show exploration app that implements MVVM design pattern by following the clean architecture principles, using TMDB API.

Bora Bor 11 Dec 22, 2022
A simple store project that includes a list of products, search on products, details of the product, and review submission.

AdidasTest A simple store project that includes a list of products, search on products, details of the product, and review submission. Summary Technol

Mohammad 5 May 8, 2021
A lightweight library for requesting and consuming Activity Results using coroutines.

SuspendActivityResult A lightweight library for requesting and consuming Activity Results using coroutines, it's usage is as simple as: val uri = Acti

Hicham Boushaba 71 Dec 23, 2022
To-Do-List - Create a To Do List-style App from scratch and drive the entire development process using Kotlin

To-Do-List! Crie um App no estilo "To Do List" do zero e conduza todo o processo

River Diniz 0 Feb 14, 2022
Display scrollable list of repositories of square organization in GitHub

Display scrollable list of repositories of “square” organization in GitHub. The app should consist of only one screen (Repositories Screen). Each list

Ajith v Giri 0 Nov 30, 2021
Map-vs-list-comparator - The project compares the time needed to find a given element in a map vs the time needed to find a given element in a list.

Map vs List Comparator The project compares the time needed to find a given element in a map vs the time needed to find a given element in a list. To

null 0 Jan 4, 2022