Search

Home > Fragmented - Android Developer Podcast > 115: Architecture Components with Akshay Chordiya
Podcast: Fragmented - Android Developer Podcast
Episode:

115: Architecture Components with Akshay Chordiya

Category: Technology
Duration: 01:04:46
Publish Date: 2018-02-26 01:00:00
Description:

In this episode, we talk about the different parts of Android architecture components. We've had episodes on Room and the paging library, so in this one, we thought we'll touch a little on Lifecycle Owners & Observers, ViewModels, and LiveData. Akshay Chordiya helps break it down. Listen on!

Show Notes

Lifecycle

ViewModels

Code snippet for a ViewModelFactory:

    class UserVMFactory(
            val user: MyUser
    ) : ViewModelProvider.Factory {
        override fun  create(modelClass: Class): T {
            return when {
                modelClass.isAssignableFrom(UserVM::class.java) ->
                    UserVM(user) as T
                else -> throw IllegalArgumentException("Unknown ViewModel class")
            }
        }
    }

LiveData

Misc

Sponsors

  • Microsoft AppCenter - Sign up now on appcenter.ms and spend less time managing your app lifecycle and more time coding.

Contact

Total Play: 0

Users also like

300+ Episodes
Android Deve .. 40+     2