loading...

Day 2: Relearning Dagger 2

rahulchowdhury profile image Rahul Chowdhury ๐Ÿ•ถ ใƒป1 min read

It's day 2 of my job finding journey.

Where am I right now?

I started implementing a simple app using Android Architecture Components, Dagger and Kotlin.

GitHub logo rahulchowdhury / elly

Demo Android app with the new Android Jetpack ๐Ÿš€components.

elly

Demo Android app with the new Android Jetpack ๐Ÿš€components.




I didn't know Dagger 2 has come such a long way since I last learned to use it.

There's a whole new module called dagger.android, explicitly designed to reduce boilerplate Dagger code on Android projects.

View models now have a new trick called SavedStateHandle to reduce boilerplate while handling app state.

Turns out injecting a SavedStateHandle to a view model isn't straightforward. There's a lot to setup.

Currently, I'm stuck in making that work.

What am I doing today?

I'm going to take a step back and get accustomed to this new dagger.android module, first.

Then, I'm going to set up SavedStateHandle injection using Dagger in my app.

When all this is done, I'll be working on implementing & caching a single API call to show cool elephant profiles.

Any tips to guide me through this?

Final notes

I'm looking out for a job for the role of Android Engineer. I have over 3.5 years of experience, and either a career in Bangalore or a Remote job works for me.

Discussion

pic
Editor guide
Collapse
rahulchowdhury profile image
Rahul Chowdhury ๐Ÿ•ถ Author

Getting Dagger to work with view models and SavedStateHandle is taking up a lot of time with no fruition. Trying Koin right now.

Will get back to Dagger at a later point. ๐Ÿ˜