Android Error Handling in MVVM Projects (in Hindi) | CheezyCode - #21

Android MVVM Error Handling Mechanism using Sealed Classes & Generics. Learn step by step to handle errors in your Android MVVM project. Learn how to use sealed classes in Android with Generics. API errors are very common and handling them using this approach makes the code cleaner. You just need to observe the livedata with the particular state and Android UI will react accordingly.
These are the best practices to implement complete architecture to have extensible and maintainable code in android. Learn all this by implementing a simple quotes app using a third-party API. Learn how this MVVM pattern works and all the related android architecture components.
Learn all this about Android Jetpack Components in Hindi by creating small projects. These components help in writing clean code and help in following clean architecture in android. Learn all this about Android in Hindi by creating small projects. Everything is explained in Hindi (हिंदी में )
Topics Covered -
1. How to handle errors in MVVM Android Project?
2. Loading, Error, and Success State of Resource in Android MVVM
3. How to use Sealed Classes with Generics in Android
4. Complete Android MVVM Example with Error Handling
Sealed Classes Concept -
• Kotlin Enum Class and ...
Complete Android Architecture Components Playlist -
• Android Architecture C...
ViewModel Concept -
• Android ViewModel Tuto...
ViewModelFactory -
• Android ViewModel Fact...
Beginner series in Android Playlist (Hindi) -
• Android Tutorials Step...
Kotlin Beginners Tutorial Series -
• Kotlin Beginner Tutori...
Source Code -
github.com/CheezyCode/RandomQ...
For more info - visit the below link
www.cheezycode.com
We are social. Follow us at -
Facebook - / cheezycode
Twitter - / cheezycode
Instagram - / cheezycode

Пікірлер: 90

  • @chetantailor3620
    @chetantailor36202 жыл бұрын

    Great! Waiting for dependency injection part.

  • @amolwadekar44
    @amolwadekar44 Жыл бұрын

    One of the best Android learning Series on KZread. Great Work 😀

  • @AbdulRehman-hi7xk
    @AbdulRehman-hi7xk2 жыл бұрын

    A great Teacher ❤️

  • @parulson6274
    @parulson62742 жыл бұрын

    I dont know much about youtube monetisation, but, sir, can you put more ads in the video.. I dont know if youre realising how much helpful your videos are, you know how to teach...i am from bangladesh, i have never been so happy this much before, for being able to understand Hindi, people says, you will need everything you learn today, maybe this is it for me, your videos. Hats off. There are few movies like Drishyam, Ratsasaan, 3 idiots, Pk, Bajrangi Bhaijan...i felt good about understanding hindi for some of these movies too

  • @ZeeshanAhmad-zi3fr
    @ZeeshanAhmad-zi3fr9 ай бұрын

    best series seen so far

  • @bhupen9995
    @bhupen999510 ай бұрын

    such a great instructor

  • @AkashJhaDDN
    @AkashJhaDDN2 жыл бұрын

    Are iske lie bahut bahut dhanyvad bari prob ho gai thi Mvvm exception handling apne Sai se bata dia

  • @udaychafale
    @udaychafale2 жыл бұрын

    As always simply explained 👌. Waiting for unit testing tutorials

  • @khapp7821
    @khapp78212 жыл бұрын

    Awesome. I am from Bangladesh and Bengali but I understand your lessons so much clearer. Hope we will get more things soon

  • @preetamgupta3532
    @preetamgupta35322 жыл бұрын

    Awesome explanation Sir 🙏

  • @KDTechverse
    @KDTechverse10 ай бұрын

    Ek number video ! 💯 🙌 banana band mat karna warna paap padega 😂

  • @prolaymm
    @prolaymm9 ай бұрын

    Thank you for your high quality video tutorials.

  • @ankiiiiit7866
    @ankiiiiit78662 жыл бұрын

    Great explaination

  • @mihirshirgaonkar7832
    @mihirshirgaonkar78322 жыл бұрын

    learnt all the concepts of mvvm

  • @CheezyCode

    @CheezyCode

    2 жыл бұрын

    Thanks Mihir

  • @jatinvashisht4293
    @jatinvashisht42932 жыл бұрын

    Very nice explanation sir, I was struggling to understand the application to sealed classes.

  • @pritech8302
    @pritech83022 жыл бұрын

    thank you so much sir...

  • @samirgawas
    @samirgawas2 жыл бұрын

    Thanks Sir for this great playlist🙏

  • @CheezyCode

    @CheezyCode

    2 жыл бұрын

    Thanks Samir. Please help us spread the word. 🤘

  • @mihirshirgaonkar7832
    @mihirshirgaonkar78322 жыл бұрын

    thanks you so much

  • @raunaksingh7512
    @raunaksingh75122 жыл бұрын

    Brillantly explained !

  • @CheezyCode

    @CheezyCode

    2 жыл бұрын

    Thanks Raunak

  • @mahmoodimtiaz2550
    @mahmoodimtiaz25502 жыл бұрын

    A clear explanation as always!!!! Hope you will implement Paging library .

  • @Sweetcracks
    @Sweetcracks2 жыл бұрын

    Thank You!

  • @rishikeshsingh9946
    @rishikeshsingh9946 Жыл бұрын

    Thanku sir

  • @CheezyCode

    @CheezyCode

    Жыл бұрын

    Thanks 🤘

  • @poornabhaskarduvvari2954
    @poornabhaskarduvvari29542 жыл бұрын

    Excellent

  • @sunilnraikar409
    @sunilnraikar4092 жыл бұрын

    Thanks sir

  • @sadaqathussain2062
    @sadaqathussain20622 жыл бұрын

    Great sir

  • @vikramsinghnegi1559
    @vikramsinghnegi15592 жыл бұрын

    Great Video sir, well explained. 👌👌 I request you, please also make videos on Dagger Hilt in Android. 🙏🙏🙏

  • @S_Crypto
    @S_Crypto2 жыл бұрын

    Thank you 💕

  • @CheezyCode

    @CheezyCode

    2 жыл бұрын

    You’re welcome 😊

  • @kushal7966
    @kushal79662 жыл бұрын

    Thanks for video sir...

  • @CheezyCode

    @CheezyCode

    2 жыл бұрын

    Thank you codebook

  • @roushanali1918
    @roushanali19182 жыл бұрын

    this video deserves so much more love than it has got.... i have been struggling wrapping my head around error handling but this video just made it seem so simple and IT WORKS 😍👌 Also Could you please explain how to use HTTP Interceptors for things like centralised error handling, Authorization Token etc?

  • @CheezyCode

    @CheezyCode

    2 жыл бұрын

    Yes next series with all the things

  • @manshalkhatri9289
    @manshalkhatri928911 ай бұрын

    Helpful

  • @tanveerahmed729
    @tanveerahmed7292 жыл бұрын

    zabardast conceptual video. Please share a post, update and delete api example and also tells that how we show progress dialog from repository.

  • @piyush288
    @piyush2882 жыл бұрын

    Waiting for the complete utilizable app

  • @kingcoder7654
    @kingcoder76542 жыл бұрын

    ❤️❤️

  • @theuntoldtree
    @theuntoldtree2 жыл бұрын

    Finnally finished, learnt a lot Kindly make video on unit testing .

  • @CheezyCode

    @CheezyCode

    2 жыл бұрын

    Cheers man...mann kare toh please share it 😁

  • @theuntoldtree

    @theuntoldtree

    2 жыл бұрын

    @@CheezyCode already done

  • @theuntoldtree

    @theuntoldtree

    2 жыл бұрын

    @@CheezyCode Sir, why cheezy code linkedin profile shows location of usa? You have accepted my linkedin request a hour ago, Sumit kumar this side.

  • @yup7722
    @yup77228 ай бұрын

    Hi Sir, what is the best approach related to live data? , 1- Repo will return the networkResponse class(containing data or error) and my live data will be in the view model (there will be no live data in repo), 2- same thing which you have done in the video i-e putting the live data in repos and just observe from view model. It will be very helpful if you can give a small explaination as well for us to understand, thanks in advance

  • @sudhirthanki
    @sudhirthanki Жыл бұрын

    Nice videos!! I have a question that if i want use one RetroFit API result to another api so how can we wait until the first one is finished. Also, do you have any videos / examples on handling incoming VoIP call with android telecom / ConnectionService ? Thanks

  • @rkthebeast6910
    @rkthebeast69102 жыл бұрын

    bro pagination from jetpack component kb video aa a gaa

  • @milangajera2129
    @milangajera21292 жыл бұрын

    Hello Sir, I have used MVVM for login to learning from you tutorials videos.when i enter wrong password then it's show the snackbar after that when i enter correct password and press login button it will not goes to make API call and show directly the msg which i got previously from the API into the snackbar.

  • @komalraghav5716
    @komalraghav57162 жыл бұрын

    Hi, Please make tutorial for Creational design patterns.

  • @CheezyCode

    @CheezyCode

    2 жыл бұрын

    Sure 😊 - I am planning a short series on design patterns..

  • @kushalpratap6630
    @kushalpratap66302 жыл бұрын

    Sir please, when you make a video on flow topic?

  • @CheezyCode

    @CheezyCode

    2 жыл бұрын

    Soon...

  • @adityagaikwad9935
    @adityagaikwad99352 ай бұрын

    Do I have to create MutableLiveData for every api call that I make in that repository?

  • @MukeshYadav-zs9ey
    @MukeshYadav-zs9ey2 жыл бұрын

    Hi Sir, Thank you for the series. I want to clone the final source code but its not allowing me to clone. Please help.

  • @CheezyCode

    @CheezyCode

    2 жыл бұрын

    Download it

  • @krishnakumar-kh5vo
    @krishnakumar-kh5vo2 жыл бұрын

    Can we use object for Loading ???....since it will be one and similar throughout the application... ...

  • @CheezyCode

    @CheezyCode

    2 жыл бұрын

    yes and no...sealed class likhne se benefit hai - kyoki when lagaoge toh saare cases handle karne he padege...deterministic cases honge..i.e. it could be only 3 options - Success, Error, Loading

  • @krishnakumar-kh5vo

    @krishnakumar-kh5vo

    2 жыл бұрын

    @@CheezyCode got is sir

  • @learner5439
    @learner5439 Жыл бұрын

    Sir, that's d only reason why I came here..... Ye jo ghol k pila dete ho na Sir bs... its no where else.

  • @AkashJhaDDN
    @AkashJhaDDN2 жыл бұрын

    sir isme Coroutine kidhar call hoga, i mean aapne suspend function repo me banya to ye coroutine se hi to acess hoga. vo coroutine kidhar likhna hoga kuki activity to viewmodel se read kar raha hai jo ki suspend nai hai.

  • @CheezyCode

    @CheezyCode

    2 жыл бұрын

    ViewModel scope ka use kiya hai ViewModel mei suspend function ko call karne ke liye

  • @AkashJhaDDN

    @AkashJhaDDN

    2 жыл бұрын

    @@CheezyCode ok sir thankyou

  • @kishorramani007
    @kishorramani0072 жыл бұрын

    Thanks bhai, This series help a lot in work environment. Is this series finish or new topic will cover in future? Also, Please create jetpack compose series with application example.

  • @CheezyCode

    @CheezyCode

    2 жыл бұрын

    Back with DI videos...this series is complete for now.

  • @milangajera2129
    @milangajera21292 жыл бұрын

    Hello Sir, I followed all the videos to learn MVVM and implemented it in my real project. I used the same pattern to implement MVVM the pattern are Repository in which i make api call which is call by the viewmode and viewmodel is registered in the activity/fragment. When i change the configuration then it's again call an APIs from any activity. What is the crusial thing i missing?

  • @CheezyCode

    @CheezyCode

    2 жыл бұрын

    Is the data available in your ViewModel? Make sure you are not calling the endpoints if you have data in your viewmodel

  • @milangajera2129

    @milangajera2129

    2 жыл бұрын

    @@CheezyCode I have used the same as you describe in video but it's again call the API when configuration chage. I have not use the init{} in ViewMode defined a function inside the view model and then use this function by using the viewmodel object.

  • @CheezyCode

    @CheezyCode

    2 жыл бұрын

    Debug it...you will get it

  • @CheezyCode

    @CheezyCode

    2 жыл бұрын

    Or do one thing- api call se jo result aa rha h usse ViewModel mei as a field store karlo...and use that to access data from activity or fragment

  • @milangajera2129

    @milangajera2129

    2 жыл бұрын

    @@CheezyCode Hello Sir, Good Morning. I have to make an API call again to get my wishlist products. Once I remove any product from the wishlist then I have to refresh the wishlist API call to get the remaining products on the wishlist again. These cause a problem. How can I achieve this where I have to make an API call again and it will also survive the configuration changes as well? I have sent an email with my code.

  • @sidaldar5552
    @sidaldar55522 жыл бұрын

    Is series mai kitane videos?

  • @NeerajYadav
    @NeerajYadav2 жыл бұрын

    can we create common repository class for whole project

  • @CheezyCode

    @CheezyCode

    2 жыл бұрын

    by common means?

  • @NeerajYadav

    @NeerajYadav

    2 жыл бұрын

    @@CheezyCode like genric type of repository class. Because in a large project there will be so many classes and its really hard to find one after some time

  • @CheezyCode

    @CheezyCode

    2 жыл бұрын

    Generally interface define karte hai Repository ka fir uski different implementation hoti. For instance - OfflineRepository, NetworkRepository Repository generally alag package mei hoti hai toh issue nahi hota chahe jyada files ho...mvmm follow ho rha hota hai agar kisi project mei toh generally team is aware about the Repository

  • @CheezyCode

    @CheezyCode

    2 жыл бұрын

    This is based on few implementation we have done. Nothing is standard as such

  • @NeerajYadav

    @NeerajYadav

    2 жыл бұрын

    @@CheezyCode Thanks for info, One last Question -> Is it OK to initiate all repository class in Application file, and whats the main reason behind this

  • @vickykumar-sd3ih
    @vickykumar-sd3ih2 жыл бұрын

    Hi sir, How to parse custom retrofit response.errorBody(), if response is not successful. E.g. My nodejs api returns json error like: {"error": { "message": "User not found", "code": 404 }} I tried lots of articles but didn't get any solution, please help me

  • @CheezyCode

    @CheezyCode

    2 жыл бұрын

    For app it is just a normal response. You need to put a check in place if code is 404

  • @vickykumar-sd3ih

    @vickykumar-sd3ih

    2 жыл бұрын

    @@CheezyCode I want any types of error handling. I have written sign up api and it returns errors like "username is already taken", "email is already taken", "emails is invalid", etc. How to parse api response error body with custom data class, if response is not successful.

  • @CheezyCode

    @CheezyCode

    2 жыл бұрын

    API ki json dekh ke he bta paunga

  • @vickykumar-sd3ih

    @vickykumar-sd3ih

    2 жыл бұрын

    @@CheezyCode if response is successful json return an user reponse model like: { "user": { "id": 1, "username": "xyz", "email": "test@test.com" } } if response is not successful json return an error reponse model like: { "error": { "message": "Username is already taken", "code": 422 } } In error.message property value could be anything according to error, e.g. "Email is invalid", "Email is already taken", etc

  • @shubhamshrivastava1467
    @shubhamshrivastava14672 жыл бұрын

    bhaiya apne pura github par code nahi dala hai please update kr degia

  • @CheezyCode

    @CheezyCode

    2 жыл бұрын

    system crashed. need to check if I have it right now. But changes will be same as shown in the video

  • @mubaraknative
    @mubaraknative11 ай бұрын

    Phillip Fans attendance Here 😀😄

  • @CheezyCode

    @CheezyCode

    11 ай бұрын

    But why yaar 😂

  • @mubaraknative

    @mubaraknative

    11 ай бұрын

    @@CheezyCode your code style is like philip and i like your apprach the way of teaching

  • @tarunkaul7178
    @tarunkaul71782 жыл бұрын

    As always simply explained 👌. Waiting for unit testing tutorials

  • @CheezyCode

    @CheezyCode

    2 жыл бұрын

    Thank you Tarun