Giter Site home page Giter Site logo

amitshekhariitbhu / mvvm-architecture-android Goto Github PK

View Code? Open in Web Editor NEW
514.0 13.0 112.0 520 KB

MVVM architecture using Kotlin, Dagger, Retrofit, Coroutines, Flow, StateFlow, and etc.

Home Page: https://amitshekhar.me/blog/mvvm-architecture-android

Kotlin 100.00%
mvvm mvvm-architecture mvvm-android kotlin android android-architecture coroutines dagger2 flow retrofit

mvvm-architecture-android's Introduction

MVVM Architecture Android Beginners: Sample App

This repository contains a sample app that implements MVVM architecture using Kotlin, Dagger, Retrofit, Coroutines, Flow, StateFlow, and etc.





My Personal Blog - amitshekhar.me - High-quality content to learn Android concepts.

Major Highlights

  • MVVM Architecture
  • Kotlin
  • Dagger
  • Retrofit
  • Coroutines
  • Flow
  • StateFlow

The app has following packages:

  • data: It contains all the data accessing and manipulating components.
  • di: It contains all the dependency injection related classes and interfaces.
  • ui: View classes along with their corresponding ViewModel.
  • utils: Utility classes.

Resources to learn MVVM Architecture and other components used in this project:

  • MVVM Architecture: MVVM Architecture - Android Tutorial
    • We will cover the following in this tutorial:
      • What is MVVM architecture?
      • Set up a new project with Kotlin and other dependencies required.
      • Project Structure.
      • Set up the utils package.
      • Set up the data layer.
      • Set up the di layer.
      • Set up UI layer, build and run the project.
      • Project Source Code and What Next?
  • Mastering Kotlin Coroutines: Mastering Kotlin Coroutines
  • Flow API in Kotlin: Flow API in Kotlin
  • Learn Kotlin Topics: Kotlin Blog

You can connect with me on:

Read all of my blogs here.

License

   Copyright (C) 2022 Amit Shekhar

   Licensed 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.

Contributing to Android MVVM Architecture

Just make pull request. You are in!

mvvm-architecture-android's People

Contributors

amitshekhariitbhu avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

mvvm-architecture-android's Issues

None of the following functions can be called with the arguments supplied:

None of the following functions can be called with the arguments supplied:

public open fun of(fragment: Fragment, factory: ViewModelProvider.Factory?): ViewModelProvider defined in android.arch.lifecycle.ViewModelProviders

public open fun of(activity: FragmentActivity, factory: ViewModelProvider.Factory?): ViewModelProvider defined in android.arch.lifecycle.ViewModelProviders

How to use MVVM for Recycleview loadmore action

Thank you for your article. I would like to know, according to Android Official Guide of Unidirectional Data Flow, should I call uiState.Success(newAllList) when I pull more data, or add a new state: uiState.SuccessLoadMore(appendList)?

In the first case, I need to use DiffUtil ,If I have a large list but only want to append 20 pieces of data to it, is it not worth the loss? I prefer to use the second method and then call adapter.notifyItemRangeInserted(). I am very confused about this. How do you recommend I do it? Thank you very much for your answer.

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.