Skip to content

desnyki/MovieDB

Repository files navigation

Movie DB

A Movie discovery app illustrating current Android Architecture state using Android development best practices.

This product uses the TMDb API but is not endorsed or certified by TMDb.

Introduction

The application is based on MVVM and Repository patterns. Implemented Architecture principles follow Google recommended Guide to app architecture.

Guide to app architecture

The application is written entirely in Kotlin.

Android Jetpack is used as an Architecture glue including but not limited to ViewModel, LiveData, Lifecycles, Navigation, Room and Data Binding. See a complete list in "Libraries used" section.

The application does network HTTP requests via Retrofit, OkHttp and GSON. Loaded data is saved to SQL based database Room, which serves as single source of truth and support offline mode.

Paging library will be used for data pagination online and offline in the future.

Kotlin Coroutines manage background threads with simplified code and reducing needs for callbacks.

Work manager does synchronisation job being compatible with Doze Mode and using battery efficiently. Navigation component manages in-app navigation.

Dagger 2 is used for dependency injection.

Glide is used for image loading.

A sample app currently consist of 2 screens: List of recent movies, and movie details.

Screenshots

MovieDiscoveryFragment MovieDetail

Libraries Used

The application goal is to show case current Android Architecture state using out of box Android tools made by Google (Android Jetpack) and 3rd party community driven libraries.

Android Jetpack is a set of components, tools and guidance to make great Android apps. They bring together the existing Support Library and Architecture Components and arranges them into four categories:

Android Jetpack

  • Foundation - Components for core system capabilities, Kotlin extensions and support for multidex and automated testing.
    • AppCompat - Degrade gracefully on older versions of Android.
    • Android KTX - Write more concise, idiomatic Kotlin code.
    • Test - An Android testing framework for unit and runtime UI tests.
  • Architecture - A collection of libraries that help you design robust, testable, and maintainable apps. Start with classes for managing your UI component lifecycle and handling data persistence.
    • Data Binding - Declaratively bind observable data to UI elements.
    • Lifecycles - Create a UI that automatically responds to lifecycle events.
    • LiveData - Build data objects that notify views when the underlying database changes.
    • Navigation - Handle everything needed for in-app navigation.
    • Room - SQLite database with in-app objects and compile-time checks.
    • ViewModel - Store UI-related data that isn't destroyed on app rotations. Easily schedule asynchronous tasks for optimal execution.
    • WorkManager - Manage your Android background jobs.
    • Paging - Load and display small chunks of data at a time.
  • UI - Details on why and how to use UI Components in your apps - together or separate.
  • Third party
    • Kotlin Coroutines for managing background threads with simplified code and reducing needs for callbacks.
    • Dagger 2 A fast dependency injector.
    • Retrofit 2 A configurable REST client.
    • OkHttp 3 A type-safe HTTP client.
    • GSON A Json - Object converter using reflection.
    • Glide Image loading.

License

Copyright 2020 Marcin Deszczynski.

Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages