How to Make a Clean Architecture Cryptocurrency App (MVVM, Use Cases, Compose) - Android Studio

Поделиться
HTML-код
  • Опубликовано: 23 ноя 2024

Комментарии • 540

  • @PhilippLackner
    @PhilippLackner  3 года назад +246

    2 little corrections from my side:
    1. In this video I mapped the DTO to a model in the domain layer. You should rather do this in the data layer (in the repository)
    2. The response handling should also rather be done in the repository (catching HttpException & IOException) as this is specific to Retrofit and the domain layer shouldn't know about that.
    Sorry that I didn't show that in the video, but I also never stop learning :)

    • @mdazharuddin4684
      @mdazharuddin4684 3 года назад

      So repository should return Resource?

    • @LakshyaMathersShady
      @LakshyaMathersShady 3 года назад +2

      @@mdazharuddin4684 Yes

    • @erolyildiz3693
      @erolyildiz3693 3 года назад +19

      can you upload the corrected codes as a new branch to the git, would be appreciated, thanks so much

    • @LakshyaMathersShady
      @LakshyaMathersShady 3 года назад

      @@erolyildiz3693 All you need to do is move the code from use case to repoImpl and handle calling code

    • @smnsrl
      @smnsrl 3 года назад

      Using coinId from the constants would also be better imho

  • @MohammedElotol
    @MohammedElotol 2 года назад +18

    Great work, thank you.
    But in 29:00 the main reason we create a repository interface (which is the Gateway in clean architecture terminology) is to invert the dependency so that the domain layer must no know anything about the outer layers including repositories (Gateway implementation) therefore repository interface abstract functions must return domain models instead of DTOs.
    this way we guarantee that we don't violate the DEPENDENCY RULE which is the most important thing in Clean architecture.
    Thank you again for your efforts.

    • @MohammedElotol
      @MohammedElotol 2 года назад +4

      And the job of RepositoryImpl functions are to work as an adapter and convert DTOs to domain models in addition to orchestrating data persistence and their exceptions.

    • @PhilippLackner
      @PhilippLackner  2 года назад +3

      @@MohammedElotol correct, thanks

  • @baijusharma6027
    @baijusharma6027 3 года назад +135

    Thank you, Philipp keeping this video free for the developers. It's a gold mine.

    • @PhilippLackner
      @PhilippLackner  3 года назад +20

      My pleasure!

    • @subramanianchenniappan4059
      @subramanianchenniappan4059 11 месяцев назад +1

      Yes

    • @disgruntled_llama
      @disgruntled_llama 6 месяцев назад

      This is the single most helpful video on Android development that I've found on RUclips. It inspired me to buy some of your courses.
      When it comes right down to it, this is what the majority of Android apps do. Download something, then display more information about it when the user indicates.

  • @Dibyendu.M
    @Dibyendu.M Год назад +2

    Recently, I have completed this project (code along). As a beginner, there are so many things to learn. Thank you, mate.

  • @Eduardo-fx9ih
    @Eduardo-fx9ih Год назад +2

    I believe this video is "mandatory" to see, for each Android developer looking to improve and implement Clean Architecture. Philipp you rocks!!!

  • @bassline2029
    @bassline2029 3 года назад +1

    Just graduated and this is the best course i could came across to get an idea about clean arch!! Good Job!!!

  • @harrishmurugesan8869
    @harrishmurugesan8869 2 года назад +5

    This is literally one of the best Android Related video i have ever seen! Learnt soo much from this mini project and your explanation is bloody brilliant!

  • @HaSeebpjr01
    @HaSeebpjr01 4 месяца назад +1

    the best person with great voice, personality and knowledge in the planet. thanks for your great contents.

  • @ChrisAthanas
    @ChrisAthanas 2 года назад +1

    I just finished this course and have a SOLID handle on how to structure modern Android apps. I finally understand why and where to use Flows! And DTO's are much clearer. Also getting really good with compose now.

  • @sumitpatil339
    @sumitpatil339 2 года назад +3

    Thank you Philipp for such wonderful course.
    In video 28.11, We are using Data Layer DTO class in domain. This is the violation of Clean Architecture rules as domain layer is independent from all other layers. We need to change CoinRepository, GetCoinsUseCase, CoinRepositoryImpl and getCoinsUseCase to fix above suggested change.

  • @tinythings677
    @tinythings677 3 года назад +3

    Finally, you use single activity and no fragment. Love it.

    • @PhilippLackner
      @PhilippLackner  3 года назад

      For jetpack compose nothing else makes sense

    • @jatinvashisht4293
      @jatinvashisht4293 3 года назад

      @@PhilippLackner okay, so this means we are out of the activity-fragmnet hell?

    • @PhilippLackner
      @PhilippLackner  3 года назад

      @@jatinvashisht4293 yea

    • @jatinvashisht4293
      @jatinvashisht4293 3 года назад

      @@PhilippLackner wow, that's very good actually 👏.
      BTW thanks for replying 🙂

  • @TomaszRykala
    @TomaszRykala 2 года назад +1

    Incredible work. I can't believe you typed all that code in one breath without launching the app until the very end. Super impressive and very very helpful. Thanks so much!

    • @TheZaurHasanov
      @TheZaurHasanov Год назад +1

      He is launching it in his brain automatically 😄

  • @satyajitmishra4809
    @satyajitmishra4809 2 года назад

    One of the most required videos for Android Developers

  • @audhil
    @audhil 3 года назад +5

    This guy shares all the topics which I start to explore every time! This video is a gem! Kudos & Respect!

  • @morancha85
    @morancha85 11 месяцев назад +2

    Philipp, you are the absolute best! Your work is so appreciated! Really helpful and concise!

  • @karabomatsemela9196
    @karabomatsemela9196 2 года назад

    The best clean architecture using compose I've ever seen.

  • @gabrielwahle2519
    @gabrielwahle2519 3 года назад +2

    Can't believe such quality content is available for free.
    Chapeaux and thank you, this is not common nowadays

  • @emmanuelpregnolato5026
    @emmanuelpregnolato5026 2 года назад

    Watching all the adds so you get something back.
    Thank you.

  • @sahibjadatalibansari7365
    @sahibjadatalibansari7365 3 года назад +1

    So much informative movie. I did not realize that I am Studying. I am blown away by this 😲😲😲.
    After watching it in one go I was finding 1000 likes button.

  • @antonyfilochowski335
    @antonyfilochowski335 6 месяцев назад

    interesting & informative - especially enjoy the "reality" of real time error fixing in the code, on-the-fly decisions ("we'll put it here no, wait add it to main activity.." or whatever) - more fun 'cos spontaneity less boring than the standard classroom/presentation stuff - more natural in this "long form" 90 minute coding chat & code format
    well done
    thnx again

  • @jimpauloovejera2599
    @jimpauloovejera2599 3 года назад

    I learnt a lot from this. One thing for sure everybody will love is a tutorial for handling Compose x Hilt scoping. Thank you for these free contents!

  • @muneerhasan
    @muneerhasan 3 года назад

    Your English accent is awesome . It will grow fast among India developer.

  • @kinggeorges625
    @kinggeorges625 3 года назад +2

    Thaks for your high quality contents. I was just looking for this subject yesterday, and today I have it for free 😊. May God bless you and assist you in all your projects in life
    Peace ✌🏿 from Congo 🇨🇩

  • @geanbrandao4987
    @geanbrandao4987 3 года назад +10

    Hi, great video, I loved it.
    I would like to see the UI/Unit tests being implemented in this project that uses clean architecture, that would be very helpful.

  • @kimcherwoo
    @kimcherwoo 2 года назад +1

    Your video course is so good. Several levels beyond Google's text-only codelabs.
    They need to send you a 1 million dollar check for your positive impact on developer community.

  • @victoralmeida1583
    @victoralmeida1583 Год назад +1

    Amazing Clean Architecture and Android development explanations.
    Thank you.

  • @joelkibona9571
    @joelkibona9571 Год назад

    Awesome Course
    We need one merged in both Local Database and Network Requests Clean Architecture.

  • @jatinvashisht4293
    @jatinvashisht4293 3 года назад +8

    If I have to say one word, I would say:
    *Masterpiece*

  • @matt-g-recovers
    @matt-g-recovers 3 года назад +8

    How about a dive into Domain Driven Design / Development?
    May also help folks understand why we use "domain" as part of our architectural designs.

  • @Crowbaen
    @Crowbaen 2 года назад +1

    Thank You Philipp. You have taught me so much about architectures. I have a very high paying and satisfying job because of you. Love and wishes for you.

    • @PhilippLackner
      @PhilippLackner  2 года назад +2

      Congrats mate, glad my stuff helps!! :)

  • @muindi.stephen
    @muindi.stephen Год назад +1

    I use the clean architecture to develop complex app for companies..👍 I like the tutorial

  • @cosmicdioxide
    @cosmicdioxide 4 месяца назад

    Hey man! I personally want to thank you for this great video. I'm in a process of switching career from QA to mobile dev and this video is incredibly helpful. Your explanations are very clear and understandable even for a total noob like me. Keep it up the good work! I still can't believe this video is free. You're actually doing God's work! Thank you so much!

    • @PhilippLackner
      @PhilippLackner  4 месяца назад +1

      @@cosmicdioxide happy to help 🙏🙏

  • @amolaggarwal1979
    @amolaggarwal1979 2 года назад +1

    Thank you very much bro for your contribution to the developer community.

  • @codinginflow
    @codinginflow 3 года назад +91

    2017 - God activities
    2021 - God ViewModels
    2025 - God Use cases
    2029 - ?

    • @shijilal
      @shijilal 3 года назад +5

      God Kotlin

    • @hellosagar
      @hellosagar 3 года назад +1

      Master!

    • @trocchiettoski
      @trocchiettoski 3 года назад

      God AI

    • @XarjunX
      @XarjunX 3 года назад +15

      God Composables

    • @gabrielvasconcelos4055
      @gabrielvasconcelos4055 3 года назад

      2025 will actually be Agent Smith Use cases, where your code base has use cases scattered all around that do the exact same thing

  • @sumit180288
    @sumit180288 Год назад +1

    As you said in your comment that Repository should return the Response objects. Will this same architecture work for the data source which itself returns a flow for example Room database?

  • @miltonpimentel3769
    @miltonpimentel3769 3 года назад

    Hi all right, a video suggestion, apply unit tests throughout the app with best practices
    Congratulations for the excellent video

  • @justmeagain9302
    @justmeagain9302 6 месяцев назад

    this is so cool. I think this is my second time watching this video. I couldn't really get it at first then I "actually" learned the fundamentals like some prerequisite knowledge for this video and I manage to understand the concepts quite nicely.

  • @tonnie7079
    @tonnie7079 3 года назад

    I am halfway through this video n guess what? ... I'm totally blown off - it is like a good dream that I don't want to end. Clear explanations, top Android tricks n concrete Android Architecture. And this is what I plan to do on finishing - first I will Like, the second thing is to share with the whole world, thirdly subscribe ... in short I will click every button underneath this great video including 'Break-Up with ur Girlfriend' button if I see it.

  • @vitorferreira5464
    @vitorferreira5464 2 года назад

    This is the best Clean Architecture tutorial I've ever seen. Thank you very much!

  • @rajaarumugam2018
    @rajaarumugam2018 Год назад

    After watching this video, I can get knowledge about use cases with clean architecture. 👍
    Very good job.. 👏👏🔥

  • @jatinvashisht4293
    @jatinvashisht4293 3 года назад +1

    Just finished video, what a wonderful video.
    Amazing 👏

  • @NikNewNik
    @NikNewNik 7 месяцев назад +1

    Thank you very much, Philipp!👍

  • @masatoshitakada760
    @masatoshitakada760 2 года назад +1

    Thank you for this awesome tutorial!
    Just one question below
    Is there any usage on the saveStateHandle of ConinDetailViewModel? since it doesn't seem to be set from anywhere

  • @alperencevlik3104
    @alperencevlik3104 Год назад

    This is the best video I watched on your youtube channel. Thanks for your support.

  • @gamesforu6619
    @gamesforu6619 2 года назад

    Really the best explanation on youtube in clean arch in android

  • @eunjeongchoi5074
    @eunjeongchoi5074 3 года назад

    hello from S.Korea! I was struggling with my project trying to structure it in clean architecture and your video helped me so much!!! I think I finally got the idea ! thank you so much Philipp :D

  • @MKRN_2024
    @MKRN_2024 3 года назад +10

    Hey Philipp, thank you so much for this incredibly valuable content. I was wondering if you would mind creating another video series on Clean Architecture with D/B caching and possibly unit testing included some time in your next teaching journey. The reason is because I think it would solidify everyone's understanding on clean architecture (through repetition). If you make it a paid-course, I would still definitely not hesitate to buy it. But anyways, thank you so much.

  • @go_better
    @go_better Год назад

    Thanks a lot! I will need some practice to completely undersrand it, but it makes sense. I only need understand presentation layer - VM-Activity/Fragment link, but I guess I can revisit your videos on the subject.

  • @lucyanxyz
    @lucyanxyz Год назад

    Really enjoyed watching your video on structuring the app using MVVM. I just have 2 notes on extending this further and have the dependencies between layers unidirectional:
    1. Data Acces should not depend on the Domain and therefore I would create the mapping between DTOs and Models in the domain: Coin.fromDTO(coinDTO: CoinDTO): Coin
    2. I would move the CoinRepository interface in the Data Access layer for the same reason as above

    • @PhilippLackner
      @PhilippLackner  Год назад +1

      Then you misunderstood something. It's the other way around, domain shouldn't depend on data. Any layer can access domain

    • @lucyanxyz
      @lucyanxyz Год назад

      You are right. Thanks

  • @programmingwithmati
    @programmingwithmati 3 года назад +6

    Mate! These tutorials are amazing! I can imagine how much effort these take! I do tutorials myself, more server backend oriented, but I'm learning from you to do Mobile apps with Kotlin! I'd love to partner with you for full-stack tutorials or development!
    Cheers!

  • @samferrer
    @samferrer 3 года назад

    Wonderful... just one thing missing ... a graph representing the web of dependencies ... shown along the video ... so one can follow the logic visually

  • @coldwolf5050
    @coldwolf5050 3 года назад +1

    Thank you for this. I just started to get into android with compose and this helps me understand why are certain things the way they are a little better :)

  • @bhagavanreddy104
    @bhagavanreddy104 Год назад

    Very useful for me to understand the use cases..Thank you very much Philipp

  • @mohamedhussien2101
    @mohamedhussien2101 Год назад

    I have worked on my own do the whole instruction from this course and learned a lot of stuff, Can I share what I have learned with my Git?

  • @AntonioGonzalezsanchez
    @AntonioGonzalezsanchez 3 года назад

    This is a Masterclass on Android!

  • @barneus
    @barneus 3 года назад +1

    Thank you Philipp! These videos are Solid Gold, please keep doing these videos

  • @kazimd.saidul4212
    @kazimd.saidul4212 3 года назад

    Thanks for sharing clean architecture with MVVM.
    Please continue video with unit testing, UI tested,

  • @chianjia99
    @chianjia99 2 года назад

    12:54
    what is Resource Class?
    did u make it or any reference that i can find for further study?

  • @KO7MO7
    @KO7MO7 2 года назад +1

    Thanks a lot! Your coding style is amazing, I really enjoy looking at it. I hope you know how people appreciate the hard work you have done!!! Best regards!!!

  • @johnpunzak8916
    @johnpunzak8916 3 года назад

    Thanks very much Phillipp! I enjoyed creating the app as I watched the video, and it worked great upon completion. Thanks for teaching about the architecture of apps. I cannot find content like this anywhere else!

  • @GabrieleRugani
    @GabrieleRugani 3 года назад +3

    Hi ! Thanks for the video :)
    Two questions:
    1) when we have to call the same UseCases in the same order in two different viewModel, we duplicate a lot of code in the viewmodels. How could we solve ?
    2) the network call should be executed in the IO dispatcher, in this case retrofit does it in the right Dispatcher automatically ??

  • @AcuScorp
    @AcuScorp Год назад +15

    you should start showing your app architectur using some diagramas not only talking. Not all is coding. To verify a clean architecture you need a good design. show prerequisites, the analysis, the design, the implementation and so on.

    • @СергейБезногов-т6у
      @СергейБезногов-т6у 7 месяцев назад +3

      I disagree. It's boring what you offer. Many hours discussions about two-three SQL tables

    • @AcuScorp
      @AcuScorp 7 месяцев назад +2

      That depends on how you present it. But thanks a lot for sharing your knowledge 😊

  • @VratislavJindra
    @VratislavJindra 3 года назад +2

    36:53 How would you approach the case when the e.localizedMessage is null and you still wanted to provide a localized custom error message to the user? To access a string resource, you would need a reference to Context (injected via constructor maybe?). What's the best approach here?

  • @dreamscrapedsicoverer
    @dreamscrapedsicoverer 2 года назад

    It is awesome to listen this topics from you and your logic. You are the best !!

  • @tomaslopez9999
    @tomaslopez9999 11 месяцев назад

    Thanks for putting together this tutorial. It's very helpful.

  • @jpdsah
    @jpdsah 3 года назад

    Now I know how to use Clean Architecture and Dagger hilt properly

  • @sahilmathur7371
    @sahilmathur7371 2 года назад +2

    Philipp If my app have multiple features so for every feature I will create all three layers again again ?

  • @onikhometuyatest6118
    @onikhometuyatest6118 2 года назад

    Most amazing Android video on the web!

  • @DeepakGupta-jr5gy
    @DeepakGupta-jr5gy Год назад

    Hi, great video, I loved it.
    I would like to see the one that uses clean architecture, that would be very helpful.

  • @alvaroisea2259
    @alvaroisea2259 3 года назад

    Thanks a lot for taking the time to makes this kind of videos, we developers really appreciate what you do and specially how you do it, big thanks!

  • @sawoodahmed9396
    @sawoodahmed9396 3 года назад +2

    Hello Philip thank you for providing this for free hope you remember me iam the one which said that your course is paid and you should put some free content on RUclips but
    Form last month I built a simple ecommerce app for on of my friends
    It was so hard for me to build it but some how I built it but yesterday he called me and asked me to add some 5 to 6 features for free I was so angry at him and banged the phone at him and I understood how
    You felt when I asked you to provide
    Your amazing skills for free I apologise for it I hope you will forgive me and thank you for being an inspiration for android developers ❤️❤️❤️

    • @PhilippLackner
      @PhilippLackner  3 года назад

      everybody needs to put food on their table. Thanks and you're welcome, happy learning

    • @sawoodahmed9396
      @sawoodahmed9396 3 года назад

      @@PhilippLackner Thanks bro I was so annoying right when I said to put paid course for free I apologise for it and pls give me a heart if you give me a heart I will know you are not angry at me now❤️❤️

    • @sawoodahmed9396
      @sawoodahmed9396 3 года назад

      Thank you brother

  • @alishanvaliani9952
    @alishanvaliani9952 2 года назад

    More Such videos, please!!!
    You are amazing Android Teacher!!! Respect!

  • @ubersticks
    @ubersticks 3 года назад +2

    This is a great lecture - it was a perfect amount of pasting vs. coding and a great example app that was simple but enough to cover all of the topics that I was interested in (Hilt, Compose, Clean, Use Cases). You are an excellent instructor. I had fun. Thank you!

  • @sarmadedge
    @sarmadedge 2 года назад +1

    I have 1 question regarding scalability of this project:
    1. If we want to add more features in this app, how can we centralize the exception handling for usecases done in try/catch blocks. If this were to scale I'm sure copy pasting catch blocks of usecases could bite in the back one day.

    • @sarmadedge
      @sarmadedge 2 года назад

      46:20 still haven't got my answer mate. Could you be kind enough to guide ?

  • @noumanpervez7465
    @noumanpervez7465 2 года назад

    I found this amazing, very well explained each and every concept. Thank you Philipp!!

  • @path_ethics
    @path_ethics 3 года назад

    Thanks a lot for this free content! Just got curious about how to deal with that try catch blocks in a better way so we wouldn't need do have try catch all over the place.

  • @sumithpattar4335
    @sumithpattar4335 2 года назад

    This is excellent video, learning ,coding and understanding 👏 Thanks so much 🙏

  • @nastenkaoo
    @nastenkaoo Год назад

    that is so helpful, danke schon for everything Phlipp Lackner

  • @codyliu2853
    @codyliu2853 3 года назад

    Nice content. you can move domain package to a pure kotlin library module, and let it has no other "details" dependencies.

  • @kacetal
    @kacetal Год назад +1

    Shouldn't you put the @SerealizedName annotation above each dto field? Because during obfuscation, the field names will change and will not match the API response.

  • @lokiksoni3519
    @lokiksoni3519 3 года назад

    I liked and enjoyed this video a lot.
    I specially logged in with google account to like this video. :)

  • @jabrane1564
    @jabrane1564 3 года назад

    love the news letter idea !
    Love the video too. Best android channel on RUclips

  • @francislegaspi2923
    @francislegaspi2923 2 года назад +1

    Wow! clearly explained, this is intermediate/senior dev stuff. I haven't touch Android in ages(Been developing Swift/iOS) and this is what I needed, Subscribed and already smashed bell button to you Sir :)

    • @PhilippLackner
      @PhilippLackner  2 года назад +1

      Glad it was helpful!

    • @advitiayanand5974
      @advitiayanand5974 Год назад

      Definitely not senior lol. People like Philipp have lowered the barrier significantly. Nowadays every developer worth their salt is learning architecture patterns and best practices.
      I myself am a junior dev, and I think I'm already late to the party.
      Thanks a lot Philipp! Enjoy your content very much.

  • @TheWasd124
    @TheWasd124 2 года назад

    Nice, Another app squished ;D
    Thanks, Philipp (still there are things that I don't quite understand but I think that you courses will help in that field, especially with discount)
    To the next App!

  • @mahdi7236
    @mahdi7236 2 года назад

    Hey Philipp, you used @inject on the CoinRepositoryImpl constructor, so you don't need to create an instance of it in the app module

  • @Srinivasan-i5w
    @Srinivasan-i5w Год назад

    Its such a more valuable content and great at all time. It's clearly understandable. More to go. Thanks for the video @Philipp.

  • @andrew3937
    @andrew3937 3 года назад

    Dude, ths a lot, u cool, and video is cool too.
    I've just started working with compose and was looking how to make nice content loading state implementation. And as a result I got in my brain much more i can imagine.
    Applause..

  • @sankalpchauhan5884
    @sankalpchauhan5884 2 года назад +9

    I think you interchanged the definitions of DTO and models at 16:00. Model is the one that contains our api response and dto is used to transform that response for our ui. That’s why it’s called a Data Transfer Object because it transfers the data from one layer of our application to another, while model contains real life entities.

  • @original_anu
    @original_anu 3 года назад

    Thanks for all the effort you put into this for free. Much love

  • @jagovanderstap4000
    @jagovanderstap4000 Год назад

    Awesome, well explained!
    Wouldn't deleting and inserting for an update cause two emits from Room (and using a transaction fix that)?

  • @rohitjakhar6672
    @rohitjakhar6672 3 года назад

    I really Enjoyed that course and watched 2 times.

  • @hardlife507
    @hardlife507 2 года назад

    Been a fan of your videos, since you had 4k subs. I been working on a stock app that is pretty far along and I became frustrated when I wanted to migrate some of my UI to jetpack compose. This is perfect and also helps me refactor some of my ugly code.

  • @j1nMatt
    @j1nMatt 2 года назад

    Man...thats a lot of folders! Great video btw. Will be great if you can make a video for just basics of making API calls without all these complexities?

  • @TheShadowvaultAwaits
    @TheShadowvaultAwaits 2 года назад

    Hello Philipp. Silly question incoming:
    In your screens why dont you check the successful state? I feel like with that code if there is an error it will render the text plus an empty box with the column? Its a lazy column though. Im confused, hah

  • @mohamedhussien2101
    @mohamedhussien2101 Год назад

    Thanks very much really helpful and helped me a lot in understanding some topics

  • @kumar_rajesh_
    @kumar_rajesh_ Год назад

    Hey @Philipp, I am trying to get page count from the api which is present in headers, with the above reference of resource file. I am not able to get that. Can you suggest something ?

  • @flowzk921
    @flowzk921 3 года назад

    Great Course Philipp! many thanks for creating and sharing this with the world!

  • @10wyk-f2y
    @10wyk-f2y Год назад

    Hello, thanks for your videos, i have a question about DI, especially about @Inject and how you use it in ViewModel, we didn't create any UseCase objects in our AppModule class so how it is exists?

  • @ghiathalbawab7698
    @ghiathalbawab7698 2 года назад

    thank you, so much good stuff, I have had empathy for the newbies already

  • @abdulmoeed3323
    @abdulmoeed3323 2 года назад

    While we are injecting the UseCases in the viewModel, why are we not providing them in the AppModule file?