# Hilt in Android Auto: From Manual Factories to a Cleaner Screen Provider

DevFeed: [Hilt in Android Auto: From Manual Factories to a Cleaner Screen Provider](<https://devfeed.tech/articles/hilt-in-android-auto-from-manual-factories-to-a-cleaner-screen-provider-22963.md>)

Original publisher: [Read original article](<https://funkymuse.github.io/posts/car-sample-with-hilt/>)

Author: FunkyMuse

Published: 2026-06-05T09:30:00Z

Content type: tutorial

Language: en

Sources: [FunkyMuse](<https://devfeed.tech/sources/funkymuse.md>)

Topics: [dagger-hilt](<https://devfeed.tech/topics/dagger-hilt.md>), [Android Auto](<https://devfeed.tech/topics/android-auto.md>), [Dagger](<https://devfeed.tech/topics/dagger.md>), [Software Testing](<https://devfeed.tech/topics/software-testing.md>)

Tags: [android](<https://devfeed.tech/tags/android.md>), [android-auto](<https://devfeed.tech/tags/android-auto.md>), [architecture](<https://devfeed.tech/tags/architecture.md>), [dependency](<https://devfeed.tech/tags/dependency.md>), [dependency-management](<https://devfeed.tech/tags/dependency-management.md>), [di](<https://devfeed.tech/tags/di.md>), [hilt](<https://devfeed.tech/tags/hilt.md>), [screen](<https://devfeed.tech/tags/screen.md>)

## AI overview

The excerpt proposes using Hilt multibinding to avoid manually passing a factory for every Android Auto screen. A `ScreenProvider` resolves screens from a map of `ScreenFactory` bindings, and a `Navigator` uses that provider to push screens; the session uses the provider for the initial screen. Screens can then use ordinary constructors and the navigator, without `@AssistedInject` factories. Because a `MainScreen` factory needs the navigator while the navigator depends on the screen provider and its factory map, injecting `Provider<Navigator>` delays resolution and breaks the circular dependency. The author presents this as an exploratory approach, not production-ready: `ScreenFactory` uses `Any` casts that could be improved with a custom KSP processor. The excerpt also mentions event channels or callbacks as alternatives for breaking the cycle, and says `Lazy` is possible but offers no significant improvement over `Provider`.

## Source excerpt

If you've ever followed the Android Auto Codelabs, you've seen the "sample" way of building a Car App. It works, it's functional, but as soon as you try to scale it beyond a simple demo, you hit a wall: Dependency Management. Keep in mind this is only one way to wire things, I'm pretty sure many others exist, I'm exploring things on Android Auto and Android Wear lately and how to connect and w...