The Ultimate guide to MVI in Android

  Переглядів 7,102

Land of coding

Land of coding

День тому

Follow me on instageram → / lofcoding
Github → github.com/mohammednawas8
LinkedIn profile → bit.ly/3l66EVg
Check out my Playlists → bit.ly/3FFX1q5
Initial Project:
github.com/lofcoding/MVIAndroid
Posts Api:
jsonplaceholder.typicode.com/...
In this video i explain Model View Intent(MVI) architecture components and how to use it in Android apps by implementing MVI with a library called Orbit MVI.
00:00 Introduction
00:58 MVI Architecture
05:26 Networking with Ktor
13:14 GetPost use case
15:44 ViewModel
27:46 Running the app

КОМЕНТАРІ: 19
@yasserakbbach7342
@yasserakbbach7342 Рік тому
This guy can do a lot in less than 30min 👏
@Landofcoding
@Landofcoding Рік тому
I appreciate that 😁
@name1566
@name1566 Рік тому
Hey Legend.. Just learned alot from your Food app playlist .. I have implemented some other stuff by my self ,called some other apis. Just Because of you.. You are less known in Ytbe but You have DIAMOND in your channels.. Just waiting for 20 days then I will start follow your Ecommerce App Playlist in my vacation of 10 days 🤗🤗 Thanks Legend 🤗 God Bless you
@Landofcoding
@Landofcoding Рік тому
Thank u so much and good luck !
@yasserakbbach7342
@yasserakbbach7342 Рік тому
Congrats man, I ended up finding his channel by searching for "The ultimate MVI guideline"
@bagdat.yakushev
@bagdat.yakushev 10 місяців тому
Thanks a lot man! I did not understand the MVI architecture for 100% because I did not see what Intent, Container & Reducer do. It would be great if you also show the logic of code inside Container & Reducer and how do they work with Intent & State? Also how would be look like the ViewState inside ViewModel if there are more than 1 view state data? For example: 1) we need to get from api some Music Singer data, while getting it we show shimmer instead of loading but only for view of Music Singer, 2) then when we got data we need to invoke other api to get all Songs of this Singer and again while getting data we show shimmer only for Songs view block
@Landofcoding
@Landofcoding 10 місяців тому
I will see if i can make a video where we build MVI from scratch. Answering your question on having multiple states for a single ui, im not sure if you can do it with Orbit MVI. But i don't see any advantages of having 2 states for a single screen. You can just add all your screen states in a data class and let your UI observe those states.
@abdullahimusa3153
@abdullahimusa3153 7 місяців тому
What happened to the GitHub repo 🙏
@stefanusayudha1853
@stefanusayudha1853 2 місяці тому
question, is this pattern you are using is official convention or is it your original. i need to know, cz i have some disagreement at some point. for example ; i used to not returning flow in the usecase. i'd rather rather do a purefunction or return a kotlin result. i just want to know if it okay to doing that, or is this some kind of official convention for the use case pattern to return flow?
@Landofcoding
@Landofcoding 2 місяці тому
Return flow or a direct result, it doesn't matter in my opinion as long as the use cases are testable. And btw i have made another video about the most common Architecture in android development now adays. check it out ukposts.info/have/v-deo/jJ-khIlsbK-Qqo0.html
@abdullahimusa3153
@abdullahimusa3153 7 місяців тому
This is great Well done
@AbhinavKumar-dl2ph
@AbhinavKumar-dl2ph Рік тому
Amazing video 🤩🤩 I just wanted to ask some questions : 1. Which architecture is better overall MVVM or MVI ? 2. What is the difference between MVI and MVP ?
@Landofcoding
@Landofcoding Рік тому
- There is no better architecture but there is a preference, but there are some considerations before choosing the app architecture like if you have many states the screen, it makes sense to use MVI because it has a better state management and cleans the viewModel. - As was mentioned in the video in context of android, MVI is build on top of MVVM and it's like an expansion of MVVM. In MVP you have a presenter which does the business work and hold your view to notify you about changes.
@neyasbit
@neyasbit 5 місяців тому
good job!
@jabrane1564
@jabrane1564 Рік тому
why so much code for a very simple task ? I get that MVI ensure a single source of truth for the state but still... its too much work and too complex for just the implementation !! If its gonna get this messy isn't better to use MVVM and work your way around state managment ?
@Landofcoding
@Landofcoding Рік тому
I wanted to explain the detailed and universal MVI architecture with all of it's components and i looked for a library like obrbit MVI which has the same components that explained in the block diagram. well, the goal of MVI is to clean up the viewModel from too many states and ensure better state management. and i know that we could achieve MVI without using an external library but again, i wanted to implement the global MVI architecture with all its components. Maybe MVI is overkill for independent projects so thats why most android developers preferer to mix between MVVM and the idea of MVI where we create a STATE and pass a data class that has the ui states and take actions from the UI events (intents) then the viewmodel determines what kind of event received and take an action based on that event.
@philipalveo
@philipalveo 9 місяців тому
It's because if you will be handling much more complex projects, you need to start in a very good architecture, because refactoring and rewriting codes is too much for a team. From our experience, but if you're sure that your not going to maintain that, go simple. No problem
@Mohit-gb9dv
@Mohit-gb9dv Рік тому
Yr videos are gr8 but they are not meant for beginners as you know most of the non-beginners dont learn by watching videos you do not get views
@Landofcoding
@Landofcoding Рік тому
Thank you But a video like this one is not meant for complete beginners, at least i expect the viewers to know MVVM
How to write your own MVI system and why you shouldn't
19:51
Matthew Dolan
Переглядів 7 тис.
MVI в Android на практике
19:20
Тимофей Коваленко (Android teacher)
Переглядів 14 тис.
ДРУГА РЕПЕТИЦІЯ alyona alyona та Jerry Heil на сцені Євробачення-2024
00:34
Євробачення Україна | Eurovision Ukraine official
Переглядів 226 тис.
BMW просто издевается над нами! Силы на исходе…
1:34:41
ИЛЬДАР АВТО-ПОДБОР
Переглядів 3,4 млн
Зомби Апокалипсис  часть 1 🤯#shorts
00:29
Современная архитектура Android-приложений с Compose
43:17
Everything You NEED to Know About Client Architecture Patterns
5:51
ByteByteGo
Переглядів 197 тис.
Make Your Code Clean With the SOLID Principles
18:24
Philipp Lackner
Переглядів 93 тис.
Most overpowered way to build mobile apps?
8:33
Beyond Fireship
Переглядів 675 тис.
The Ultimate Package Structure Guide for Android Developers
12:10
Philipp Lackner
Переглядів 31 тис.
host ALL your AI locally
24:20
NetworkChuck
Переглядів 289 тис.
Архитектура. MVI [RU] / Мобильный разработчик
26:46