PixabayImageSearch

A simple Image search app build using MVVM architecture.

General info

App uses Pixabay API service to load data using retrofit and display on the user screen.

Structural design pattern

The app is built with the Model-View-ViewModel (MVVM) is its structural design pattern that separates objects into three distinct groups:

  • Models hold application data. They’re usually structs or simple classes.
  • Views display visual elements and controls on the screen. They’re typically subclasses of UIView.
  • View models transform model information into values that can be displayed on a view. They’re usually classes, so they can be passed around as references.

Built With ?

  • Kotlin – Kotlin is a programming language that can run on JVM. Google has announced Kotlin as one of its officially supported programming languages in Android Studio; and the Android community is migrating at a pace from Java to Kotlin.
  • Jetpack Compose – Jetpack Compose is Android’s modern toolkit for building native UI. It simplifies and accelerates UI development on Android. Quickly bring your app to life with less code, powerful tools, and intuitive Kotlin APIs..
  • AndroidX – Major improvement to the original Android Support Library, which is no longer maintained.
  • Lifecycle – Lifecycle-aware components perform actions in response to a change in the lifecycle status of another component, such as activities and fragments. These components help you produce better-organized, and often lighter-weight code, that is easier to maintain.
  • ViewModel -The ViewModel class is designed to store and manage UI-related data in a lifecycle conscious way.
  • Kotlin Coroutines – A concurrency design pattern that you can use on Android to simplify code that executes asynchronously.
  • LiveData – Data objects that notify views when the underlying database changes.
  • Retrofit – Retrofit is a REST client for Java/ Kotlin and Android by Square inc under Apache 2.0 license. Its a simple network library that is used for network transactions. By using this library we can seamlessly capture JSON response from web service/web API.
  • GSON – JSON Parser,used to parse requests on the data layer for Entities and understands Kotlin non-nullable and default parameters.
  • Dagger Hilt – A dependency injection library for Android that reduces the boilerplate of doing manual dependency injection in your project.
  • Logging Interceptor – logs HTTP request and response data.
  • Coil-kt – An image loading library for Android backed by Kotlin Coroutines.

Screenshot

mage Search Screen Image Search Screen

? Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes.

Prerequisites

  • Android Studio 3.2+
  • Java JDK

Installing

Follow these steps if you want to get a local copy of the project on your machine.

1. Clone or fork the repository by running the command below

git https://github.com/mhasancse15/PixabayImageSearch.git

2. Import the project in AndroidStudio, and add API Key

  1. In Android Studio, go to File -> New -> Import project.
  2. Follow the dialog wizard to choose the folder where you cloned the project and click on open.
  3. Android Studio imports the projects and builds it for you.
  4. Add Pixabay API Key inside Constants file.
API_KEY="Your API Key here"

GitHub

View Github