Facebook Twitter Instagram
    DeepCrazyWorld
    Facebook Twitter Instagram Pinterest YouTube
    • FLUTTER
      • FLUTTER APP
        • QRCode
        • Quiz App
        • Chat GPT
        • PDF App
        • News App
        • Fitness App
        • Weather App
        • BMI Calculator
        • GAME APP
        • Ecommerce App
        • wallpaper App
        • Finance app
        • Chat App
        • Wallet App
        • Taxi App
        • Quran app
        • Music player app
      • FLUTTER UI
        • Splash Screen
        • Onboarding Screen
        • Login Screen
        • Card Design
        • Drawer
    • PROJECT
      • Android Projects
      • College Projects
      • FLUTTER APP
      • Project Ideas
      • PHP Projects
      • Python Projects
    • SOURCE CODE
    • ANDROID
      • ANDROID APP
      • GAME APP
      • ANDROID STUDIO
    • MCQ
      • AKTU MCQ
        • RPA MCQ
        • COA MCQ
        • HPC MCQ
        • SPM MCQ
        • Renewable Energy All MCQ
        • Data Compression MCQ
        • Data Structure MCQ
        • Digital Image Processing MCQ
        • Software Engineering MCQ
        • Machine Learning MCQ
        • Artificial Intelligence MCQ
      • D PHARMA MCQ
        • Pharmaceutics – I MCQ
        • Pharmacognosy MCQ
        • Pharmaceutical Chemistry MCQ
        • Biochemistry and Clinical Pathology MCQ
        • Human Anatomy and Physiology MCQ
        • Heath Education and Community Pharmacy MCQ
    • INTERVIEW QUESTIONS
      • Flutter Interview Questions
      • INTERVIEW QUESTIONS
      • Python Interview Questions
      • Coding ninjas solution
    • MORE
      • WORDPRESS
        • SEO
        • TOP 10 WORDPRESS THEME
      • PRODUCTIVITY
      • Program
      • QUOTES
    DeepCrazyWorld
    Home»ANDROID APP»How to create Simple movie app with Source code 2023
    ANDROID APP

    How to create Simple movie app with Source code 2023

    DeepikaBy DeepikaFebruary 27, 2022Updated:February 19, 2023No Comments4 Mins Read

    Create Simple movie app with Source code 2022 In this project we will consume themoviedb APIs to build a simple app that have the following features

    • Fetch Movies by categories (Popular, Top rated and upcoming ).
    • Show every movie details in separate screen
    • Cache data offline.
    • Search for movies.
    <img decoding=

    Table of Contents

    Toggle
      • App architecture
    • Model
    • View
    • ViewModel
    • Repository
    • NetworkBoundResource
    • Database
    • API and Base classes
    • Utils
    • Dependency Injection
    • Libraries
    • Additional Reading
    • READ MORE

    App architecture

    The following diagram shows how all the modules will interact with one another.

    Each component depends only on the component one level below it. For example, activities and fragments depend only on a view model. The repository is the only class that depends on multiple other classes; on a persistent data model and a remote backend data source.

    Model

    • Model Represents the data and business logic of the app.
    • Our bussiness is represented with the following classes (Movie, Category and Video)
    • Room db is used to cache the data locally and is our “single source of truth” in providing the data for the view.

    View

    • MoviesActivity: Displays list of movies depending on categories ( POPULAR , Top rated , upcoming )
    • MovieDetailsActivity: Displays movie details and it’s vidoes
    • CategoryBottomSheet: Switch between different categories
    • CategoryAdapter: inflates and displays filterList that is provided from CategoryBottomSheet
    • MoviesAdapter: inflates and displays moviesList that is provided from MoviesActivity’s fetch movies by filter/search result.
    • VideoAdapter: inflates and displays videoList that is provided from MovieDetailsActivity.
    • OnCategoryClickListener: responsible for interaction between CategoryAdapter and CategoryBottomSheet
    • OnCategorySelectedListener: responsible for interaction between CategoryBottomSheet and MoviesActivity
    • OnMovieClickListener: responsible for interaction between MoviesAdapter,SearchAdapter and MoviesActivity

    ViewModel

    • MoviesViewModel: MoviesActivity listens to movies changes that will happen when MoviesRepository is invoked to fetch the data from Remote service / Local DB
    • MovieDetailViewModel: MovieDetailsActivity listens to videos changes that will happen when MovieDetailsRepository is invoked to fetch the data from Remote service / Local DB

    Repository

    • We are using the repository pattern to interact with the remote service and our local db
    • The repository saves results into the database.
    • The repository doesn’t make unnecessary requests if the data is cached and up to date.
    • MoviesRepository: is being used by MoviesViewModel to fetch the list of movies. and also it provides the search logic
    • MovieDetailsRepository: is being used by MovieDetailViewModel to provide list of videos for specific movie.

    NetworkBoundResource

    A helper class that is used to take the decision of loading the data from the local db or from remote service.

    The following diagram shows the decision tree for NetworkBoundResource:

    NetworkBoundResource is using the local db as it’s single source of truth.For example It starts by observing the database for list of movies resource. When the entry is loaded from the database for the first time, NetworkBoundResource checks whether the result is good enough to be dispatched or that it should be re-fetched from the network.

    Database

    • We’re using room database which is built over SQLITE as our local db.
    • MovieDao: is used to insert/fetch our list of movies
    • VideosDao: is used to insert/fetch list of videos for specific movie.
    • VideoConverter: converts List
    • MovieDatabase: is responsible to provide us one and only object to access our db.
    • AppExecutors: is used to write and read from db.

    API and Base classes

    • ApiResponse: a generic class for handling responses from retrofit
    • RestApiService: provides and end point for our remote service
    • BaseActivity: is extended by any activity in the app. it declares unified structure and contains common methods for our activities.
    • BaseViewHolder: the same as BaseActivity but for ViewHolder.
    • DataWrapper: Wrappes our data call back with status and message to be able to handle different status inside views.

    Utils

    • LiveDataCallAdapter and LiveDataCallAdapterFactory: is used to get LiveData as call back from retrofit.
    • RefreshRateLimiter: is a factor in refreshing data decision.

    Dependency Injection

    Dependency injection allows classes to define their dependencies without constructing them. At runtime, another class is responsible for providing these dependencies

    • For DI we are using Koin

    Libraries

    • Retrofit for consuming REST APIs
    • Koin for dependency injection
    • Picasso for loading images from remote servers
    • YouTubeAndroidPlayerApi to preview and play videos
    • Room as persistence library.
    • Gson as data parser.

    SOURCE CODE DOWNLOAD

    Additional Reading

    • SEO Practices Everyone Should Follow SEO Rules
    • Complete Top SEO Checklist
    • Yoast Seo Premium 15.2 Nulled – WordPress SEO Plugin
    • Top 50+ SEO Interview Questions
    • What is a Backlink? How to Get More Backlinks
    • TCS INTERVIEW QUESTIONS – CLICKE HERE
    • Top 20 Interview Program Questions
    • Android Projects with Source Code
    • Python Project With Source Code
    • Python Projects Ideas
    • Machine Learning MCQ Questions
    • Highest Paying Earning Website 
    • School Database Management System 
    • Top 20 Company Interview Questions

    READ MORE

    If you found this post useful, don’t forget to share this with your friends, and if you have any query feel free to comment it in the comment section.

    Thank you 🙂 Keep Learning !

    Share. Facebook Twitter LinkedIn WhatsApp Telegram Pinterest Reddit Email
    Previous ArticleScratch to Win Android Earning App (Admob, FB Ads, StartApp, Unity Ads)
    Next Article OOP’s Concept Code – Basic operations and Relational Operators

    Related Posts

    Music player app in flutter and dart using node.js music API

    ANDROID APP 2 Mins Read

    Scratch to Win Android Earning App (Admob, FB Ads, StartApp, Unity Ads)

    ANDROID APP 2 Mins Read

    Covid-19 Tracker App(Coronavirus Tracker) source code 2023

    ANDROID APP 3 Mins Read

    How to Create Snake vs Block Game App with android studio

    ANDROID APP 2 Mins Read

    Leave A Reply Cancel Reply

    Recent Posts
    • Implementing a Dynamic FAQ Screen UI in Flutter Using ExpansionTile March 29, 2025
    • Creating an Instruction UI Screen in Flutter Application March 29, 2025
    • Animated Backgrounds in Flutter: A Complete Guide March 15, 2025
    • How to make Diary App using flutter stepwise using getx August 31, 2024
    • How to Create Music Player UI screen with fully functional in flutter August 30, 2024
    • How to make ListView Builder Ui in flutter with Source Code August 29, 2024
    • Create a TabBar View in flutter with fully functional stepwise August 28, 2024
    • How to create TabBar view in flutter with source code step wise August 27, 2024
    • How to make Heart rate measure app with Flutter stepwise August 26, 2024
    • How to make ChatGpt App in flutter with source code Stepwise August 25, 2024
    Facebook Twitter Instagram Pinterest YouTube
    • About
    • Contact
    • Disclaimer
    • Privacy Policy
    Copyright by DeepCrazyWorld © 2025

    Type above and press Enter to search. Press Esc to cancel.