#4 ViewModelFactory Tutorial -Android ViewModelFactory example-Android Dependency Injection tutorial

Published: 09 February 2020
on channel: Munir Hoque
3,297
37

Today our Topic is ViewModelFactory. ViewModelFactory is a specially designed class which follows the Factory Design pattern and creates ViewModel classes for us.

Full Playlist link :    • Android ViewModel and LiveData  
Third part(Android LiveData Tutorial) link -    • #3 Android LiveData Tutorial - Androi...  
Second part(Android ViewModel Tutorial) link -    • #2 Android ViewModel Tutorial - Andro...  


ViewModelFactory also provides some kind of very simple and modular dependency injection without using any Dependency Framework which is useful for small and medium size project. On a side note, please do not use ViewModelFactory as dependency injection in large projects, use any framework like Dagger or CodeIn instead. So,in this tutorial we will see how to use ViewModelFactory and why particularly it is useful. If you already familiar with Factory Design pattern then it will be easy to understand. But if you not, don’t worry, I have explained the Factory Design pattern later in this tutorial with example.
I demonstrate a super easy and simple way to write your Dependency Injection Implementation which does not require Dagger 2. Using AndroidViewModel, you can write a Dependency Injection Container is a few lines of code.
Since this project uses ViewModelProvider.Factory, I also show you how I wire that up.

Source code for this tutorial: https://bit.ly/2Sxead7
Factory Design Pattern example - https://www.educative.io/edpresso/wha...
FaceBook Learning group :   / 545337292987590  

#AndroidViewModelFactory
#AndroidViewModelFactoryTutorial
#AndroidViewModelFactoryDependencyInjection
#AndroidAppDevelopmentTutorial
#AndroidDependencyInjection


On this page of the site you can watch the video online #4 ViewModelFactory Tutorial -Android ViewModelFactory example-Android Dependency Injection tutorial with a duration of hours minute second in good quality, which was uploaded by the user Munir Hoque 09 February 2020, share the link with friends and acquaintances, this video has already been watched 3,297 times on youtube and it was liked by 37 viewers. Enjoy your viewing!