# FunkyMuse

Blog containing Kotlin and Android goodies.

This is one page of public article previews, not the complete archive. Follow Next page to continue. Summaries are not the original full articles.

## 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...

## Metro DI for KMP mobile: From God Objects and manually checked Singletons to Compile-Time Injection

DevFeed: [Metro DI for KMP mobile: From God Objects and manually checked Singletons to Compile-Time Injection](<https://devfeed.tech/articles/metro-di-for-kmp-mobile-from-god-objects-and-manually-checked-singletons-to-compile-time-injection-22965.md>)

Original publisher: [Read original article](<https://funkymuse.github.io/posts/metro-di-kmp-mobile/>)

Author: FunkyMuse

Published: 2026-05-24T17:30:00Z

Content type: tutorial

Language: en

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

Topics: [Mobile](<https://devfeed.tech/topics/mobile.md>), [Code](<https://devfeed.tech/topics/code.md>), [Android](<https://devfeed.tech/topics/android.md>), [iOS](<https://devfeed.tech/topics/ios.md>), [Java](<https://devfeed.tech/topics/java.md>), [Dagger](<https://devfeed.tech/topics/dagger.md>)

Tags: [android](<https://devfeed.tech/tags/android.md>), [code](<https://devfeed.tech/tags/code.md>), [dagger](<https://devfeed.tech/tags/dagger.md>), [di](<https://devfeed.tech/tags/di.md>), [ios](<https://devfeed.tech/tags/ios.md>), [jvm](<https://devfeed.tech/tags/jvm.md>), [kmp](<https://devfeed.tech/tags/kmp.md>), [kotlin](<https://devfeed.tech/tags/kotlin.md>), [mobile](<https://devfeed.tech/tags/mobile.md>)

### AI overview

This article describes migrating the mobile side of the Rudio Kotlin Multiplatform project from God Objects, custom thread-safe singletons, and manually managed lazy dependencies to Metro's compile-time dependency-injection graph. It explains different startup and platform-binding requirements for Android, iOS, and JVM desktop, including Android integration with Room and platform-specific Metro hooks.

### Source excerpt

The Starting Point: God Object, Custom Singletons, and Lazy Maps In the previous article i talked about how the Ktor backend replaced a God Object BackendComponent with Metro's compile-time graph. The mobile side of Rudio had a remarkably similar story, except it was more interesting because there were actually two God Objects working together and someone (looks in the code, realizes it was me...

## Metro DI for Ktor Backend: From a God Object through manual DI to Constructor Injection

DevFeed: [Metro DI for Ktor Backend: From a God Object through manual DI to Constructor Injection](<https://devfeed.tech/articles/metro-di-for-ktor-backend-from-a-god-object-through-manual-di-to-constructor-injection-22966.md>)

Original publisher: [Read original article](<https://funkymuse.github.io/posts/metro-di-ktor-server/>)

Author: FunkyMuse

Published: 2026-05-15T15:35:00Z

Content type: article

Language: en

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

Topics: [Dependency injection](<https://devfeed.tech/topics/dependency-injection.md>), [Ktor](<https://devfeed.tech/topics/ktor.md>), [constructor](<https://devfeed.tech/topics/constructor.md>), [Dagger](<https://devfeed.tech/topics/dagger.md>), [dagger-hilt](<https://devfeed.tech/topics/dagger-hilt.md>), [koin](<https://devfeed.tech/topics/koin.md>), [IntelliJ IDEA](<https://devfeed.tech/topics/intellij-idea.md>)

Tags: [accessors](<https://devfeed.tech/tags/accessors.md>), [aggregation](<https://devfeed.tech/tags/aggregation.md>), [android](<https://devfeed.tech/tags/android.md>), [android-development](<https://devfeed.tech/tags/android-development.md>), [annotations](<https://devfeed.tech/tags/annotations.md>), [anvil](<https://devfeed.tech/tags/anvil.md>), [api](<https://devfeed.tech/tags/api.md>), [auth](<https://devfeed.tech/tags/auth.md>), [authentication](<https://devfeed.tech/tags/authentication.md>), [backend](<https://devfeed.tech/tags/backend.md>), [conf](<https://devfeed.tech/tags/conf.md>), [constructor](<https://devfeed.tech/tags/constructor.md>), [default-parameters](<https://devfeed.tech/tags/default-parameters.md>), [di](<https://devfeed.tech/tags/di.md>), [framework](<https://devfeed.tech/tags/framework.md>), [kotlin](<https://devfeed.tech/tags/kotlin.md>), [ktor](<https://devfeed.tech/tags/ktor.md>), [lazy](<https://devfeed.tech/tags/lazy.md>), [metro](<https://devfeed.tech/tags/metro.md>), [object](<https://devfeed.tech/tags/object.md>), [var](<https://devfeed.tech/tags/var.md>)

### AI overview

The author replaces a manually wired `BackendComponent`--whose default constructor parameters could silently pull real dependencies into tests--with Metro's compile-time constructor injection. A `BackendGraph` gathers `@ContributesTo` bindings and `@ContributesIntoSet` route and plugin registrars, so adding or removing them does not require editing a central registry; plugin installers retain an explicit order. Stateless injected classes get fresh instances, while `@SingleIn(AppScope::class)` is reserved for shared or costly objects. For integration tests, TestContainers provides PostgreSQL/PostGIS, Redis, and MinIO; tests start a real Ktor server and obtain its live Metro graph to inspect repository state. The author contrasts this with Metro's direct-construction-with-fakes approach for unit and component tests, which they do not use for this backend's integration coverage. They note that Metro's compile-time verification costs extra build time and say they miss Dagger's IDE dependency navigation. The supplied text describes a single Gradle backend module and a possible future split, not an implemented multi-module setup.

### Source excerpt

The Starting Point: a God Object When Rudio was a created a few months ago it used the simplest possible DI: one big object BackendComponent with everything wired manually via by lazy and lateinit var. No framework, no annotations, no ceremony, then i started adding things and manual DI became a tedious and tiring task because everywhere i used default parameters to achieve default constructor...

## SQLCipher and Firebase SPM symbol conflicts can disable encryption in Kotlin Multiplatform Room databases

DevFeed: [SQLCipher and Firebase SPM symbol conflicts can disable encryption in Kotlin Multiplatform Room databases](<https://devfeed.tech/articles/sqlcipher-firebase-in-kmp-when-spm-import-symbol-conflicts-break-your-encryption-properly-encrypt-your-room-database-in-kmp-22964.md>)

Original publisher: [Read original article](<https://funkymuse.github.io/posts/encrypt-kmp-database-with-firebase-in-project/>)

Author: FunkyMuse

Published: 2026-05-12T13:30:00Z

Content type: tutorial

Language: en

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

Topics: [Kotlin](<https://devfeed.tech/topics/kotlin.md>), [Encryption](<https://devfeed.tech/topics/encryption.md>), [Firebase](<https://devfeed.tech/topics/firebase.md>), [SQLite](<https://devfeed.tech/topics/sqlite.md>), [iOS](<https://devfeed.tech/topics/ios.md>)

Tags: [cocoapods](<https://devfeed.tech/tags/cocoapods.md>), [encryption](<https://devfeed.tech/tags/encryption.md>), [firebase](<https://devfeed.tech/tags/firebase.md>), [ios](<https://devfeed.tech/tags/ios.md>), [kmp](<https://devfeed.tech/tags/kmp.md>), [kotlin](<https://devfeed.tech/tags/kotlin.md>), [sqlite](<https://devfeed.tech/tags/sqlite.md>)

### AI overview

This tutorial explains how adding Firebase iOS SDK packages through Kotlin's experimental Swift Package Manager integration caused a Kotlin Multiplatform Room database to use Apple's unencrypted sqlite3 instead of SQLCipher. It attributes the issue to identical SQLite symbols and linker precedence in statically linked frameworks.

### Source excerpt

The Starting Point I know, long title... my creativity turned into lengthy title I recently needed encrypted database storage in my Kotlin Multiplatform app using AndroidX Room. After some research, i found Paris Tsiogas's excellent guide on Encrypted Room Database in KMP which walks through the full setup, Gradle dependencies, platform-specific implementations, and a custom SQLCipherNativeDriv...

## Android ViewModel Data Loading: Best Practices and Flow-Based Architecture

DevFeed: [Android ViewModel Data Loading: Best Practices and Flow-Based Architecture](<https://devfeed.tech/articles/android-viewmodel-data-loading-best-practices-and-flow-based-architecture-22967.md>)

Original publisher: [Read original article](<https://funkymuse.github.io/posts/properly-load-data/>)

Author: FunkyMuse

Published: 2025-08-28T23:11:00Z

Content type: opinion

Language: en

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

Topics: [Android](<https://devfeed.tech/topics/android.md>), [coroutines-flow](<https://devfeed.tech/topics/coroutines-flow.md>), [software-development](<https://devfeed.tech/topics/software-development.md>), [MVVM](<https://devfeed.tech/topics/mvvm.md>), [Jetpack](<https://devfeed.tech/topics/jetpack.md>), [Jetpack Compose](<https://devfeed.tech/topics/jetpack-compose.md>), [User Interfaces](<https://devfeed.tech/topics/user-interfaces.md>), [Test-driven development](<https://devfeed.tech/topics/tdd.md>)

Tags: [android](<https://devfeed.tech/tags/android.md>), [android-development](<https://devfeed.tech/tags/android-development.md>), [antipatterns](<https://devfeed.tech/tags/antipatterns.md>), [architecture](<https://devfeed.tech/tags/architecture.md>), [best-practices](<https://devfeed.tech/tags/best-practices.md>), [data](<https://devfeed.tech/tags/data.md>), [flow](<https://devfeed.tech/tags/flow.md>), [loading](<https://devfeed.tech/tags/loading.md>), [mvi](<https://devfeed.tech/tags/mvi.md>), [mvvm](<https://devfeed.tech/tags/mvvm.md>), [viewmodel](<https://devfeed.tech/tags/viewmodel.md>)

### AI overview

The article argues that loading data in a ViewModel's `init {}` block can cause stale data on backstack returns, dispatcher timing races with Compose, and harder tests. It proposes turning cold flows into hot `StateFlow`s with sharing strategies, refresh triggers, `distinctUntilChanged()`, and optional cached state to control when data reloads. A five-second timeout is offered as an example for retaining data across brief configuration changes while refreshing when collectors return later; the author also suggests adjusting it for real-time needs. Reusable ViewModel abstractions can reduce boilerplate, though the described extension pattern does not cover complex flow chaining. The author presents this as an opinionated approach for many common cases, with tradeoffs such as added state mapping complexity, and notes that it may not fit every application.

### Source excerpt

Architecture discussions in Android development often spark passionate debates--sometimes garnering both praise and criticism. Writing about these topics isn't easy, but that's what makes it worthwhile. This article presents my opinionated perspective on data loading patterns, refined through experience and recovery from recent surgeries (one recovery is still in progress). Consider this a sna...