r/KotlinMultiplatform • • May 18 '25

[For Hire] Android/KMP developer looking for freelancing Work

0 Upvotes

Hey! I'm an android + KMP developer who can develop android, iOS, desktop, website, open to new and interesting projects/opportunities.

you can check my past project from here: HITARTH-GOHEL15 (Hitarth gohel)

my LinkedIn profile: www.linkedin.com/in/hitarthgohel

DM me if interested


r/KotlinMultiplatform • • Jul 07 '26

i got tired of paying 2 subscriptions for 1 gym habit. so i built my own app with kotlin multiplatform

0 Upvotes

MyFitnessPal for meals. Hevy for workouts.

two apps. two subscriptions. one gym session.

so i built Better — workouts + meals + macros in one app.

one codebase for android + ios. compose multiplatform (screens 100% shared), decompose, molecule presenters, ktor, sqldelight. no team, no funding, just me and long nights.

a year ago i didn't believe shared UI in production was realistic. i was wrong.

it's free right now. i'll charge for NEW features later, but what exists today stays free. no bait.

ask me anything about the stack — especially if you're on the fence about compose multiplatform. i have opinions and scars.

and if you try it — tell me the first thing that annoyed you. i've stared at this app too long to see its rough edges.

Google Play: https://play.google.com/store/apps/details?id=io.behzodhalil.better

App Store: https://apps.apple.com/us/app/better-gym-calorie-tracker/id6769016777


r/KotlinMultiplatform • • Apr 21 '26

Courses by native English speakers?

0 Upvotes

Hey there,
does anyone know if there are any KMP (or even multiplatform compose) courses that are made by someone who's native language is English? I would happily pay for a good course where I do not have to put mental energy into trying to decipher accents..

I really appreciate anyone who goes out of their way to teach their knowledge to other people, but it's just really difficult for me. For example there is one very popular content creator for KMP who does really great courses, but they mispronounce any word that ends on "-are" (so for example "sheer" instead of "share" and "compeer" instead of "compare", etc) and it's making it really difficult for me to follow what they are actually trying to say.

TL;DR:
I am looking for any (paid or free doesn't matter) KMP courses made by native English speakers.

I am thankful for any hinters into the right direction!


r/KotlinMultiplatform • • 1d ago

From Idea to TestFlight: Building a Kotlin Multiplatform App With an AI Agent

0 Upvotes

r/KotlinMultiplatform • • Oct 28 '25

Prefer .update{} over .value when modifying StateFlow

0 Upvotes
// ViewModel

private val _uiState = MutableStateFlow<CounterUiState>(CounterUiState.Success(0))
val uiState: StateFlow<CounterUiState> = _uiState


// 🔹 Using .value
_uiState.value = CounterUiState.Loading
// Replaces the state directly (not thread-safe for concurrent updates)


// 🔹 Using .update { }
_uiState.update { 
    CounterUiState.Loading 
}
// Atomically updates the state (thread-safe and preferred in MVI)

💡 Key Difference:

_uiState.value directly sets the state, while _uiState.update { } safely modifies it atomically — ideal for StateFlow in ViewModels.


r/KotlinMultiplatform • • Oct 16 '26

In the AI Era, Do People Still Buy Programming Books?

Thumbnail
reddit.com
0 Upvotes

r/KotlinMultiplatform • • 5d ago

Using Jetpack AppState (alpha) with an MVI library: what worked, and what I found out about StateStore along the way

0 Upvotes

Google released Jetpack AppState at the end of October: transform runs a @Composable block in a headless composition and gives you Compose State outside the UI, and StateStore is a keyed container for sharing state between activities, services and widgets. It's alpha, but I wanted to see how it fits an MVI architecture, so I added experimental support to Kide, my Kotlin Multiplatform MVI + Clean Architecture library.

Sharing the design and a few things I learned, since they apply to anyone trying AppState.

The design decision: AppState feeds state in, it doesn't replace the loop

A transform result is conflated. If several inputs change before the block recomposes, you get the latest value only. That's fine for "what is the current state of X", and wrong for intents, reducers and side effects, where order and exactly-once delivery matter.

So Kide doesn't make the reducer composable. Instead there's one small bridge: transformFlow { } turns a headless composition into a cold Flow, and the processor's existing observe collects it.

@OptIn(ExperimentalKideAppStateApi::class)
class SearchProcessor(
    private val savedProjects: SavedProjectsProcessor,
    private val connectivity: ConnectivityService,   // val isOnline: State<Boolean>
) : PresentationProcessor<SearchIntent, SearchViewState, SearchSideEffect>(SearchViewState()) {

    init {
        observe("connectivity", transformFlow {
            if (connectivity.isOnline.value) {
                null
            } else {
                val saved by savedProjects.stateFlow.collectAsState()
                saved.projects.size
            }
        }) { savedCountWhileOffline ->
            reduce { copy(offlineSavedCount = savedCountWhileOffline) }
        }
    }
}

Compose State and Flow are read the same way inside the block, and dependencies are tracked by what the block actually reads: while the device is online, the saved projects aren't tracked at all. The result still enters the ViewState through reduce, so interceptors, traces and tests see it like any other change.

The other direction: domain state into a StateStore

A second module mirrors a use-case processor's state into a StateStore key, so a widget, a service or another activity can read it as Compose State:

savedProjects.mirrorTo(stateStore, SavedProjectsKey, applicationScope)

// With a persisted key, restore goes through an intent, so it's a normal, traced change:
savedProjects.mirrorTo(stateStore, SavedProjectsKey, applicationScope) { persisted ->
    RestoreSavedProjects(persisted)
}

The mirror is one-way: the processor stays the only writer.

Things I found by testing AppState 1.0.0-alpha02

These aren't in the docs as far as I can tell. They're observations from my tests, and it's an alpha, so they may well change:

  • StateStore.updateState isn't atomic. 80,000 concurrent increments from 8 coroutines left me with roughly 32,000 to 40,000.

  • First access to a key isn't thread-safe. If one thread calls getState while another creates the key with setState, the reader can end up holding a State that never updates. In my probe that happened in about 4 to 5% of attempts.

  • At start-up, disk wins. With the DataStore integration, a write made before or right after syncToDataStore starts is replaced by the persisted value, and I found no signal that loading has finished.

  • statestore-datastore is Android-only in alpha02, even though statestore and transform are multiplatform.

  • Headless composition works fine on a plain JVM with no UI toolkit present, and AppState didn't force a Compose runtime upgrade next to Compose Multiplatform 1.12.

The practical upshot for me: treat a StateStore key as single-writer, create it once at application start, and don't use it as the source of truth for anything that needs ordering.

Status of Kide

Support for AppState API in Kide is experimental, and deliberately kept away from the stable library:

  • two separate artifacts, kide-appstate and kide-clean-architecture-appstate, at 2.4.0-alpha02

  • every declaration needs an explicit opt-in

  • Android and JVM only for now; iOS and Web wait for the AppState beta

  • no existing Kide module depends on them, so nothing changes if you don't add them

Repo, with the design proposal and the test code behind the findings above: https://github.com/Fuusio/kide

I'd like to hear from anyone else experimenting with AppState, especially if you've approached the "composable presenter vs. feeding a reducer" question differently, or seen different StateStore behaviour.


r/KotlinMultiplatform • • Sep 26 '26

Union class in Kotlin

Post image
10 Upvotes

Flutter's Either inspired me. It's a great way to say "this value is one thing or another". But it only has two sides: Left and Right.

But Sometimes a value could be one of three types, sometimes five. A generic sealed class can't just grow into Either<A, B, C, D, …> with as many types as I need, and writing a new sealed class every time got old fast.

So I built unionKt. Now I just list the types, any number of them, and get a type-safe union:

@Union(Int::class, String::class, User::class, Error::class) 
interface ResultSpec

Then I create it with Result(5) and handle it with when or fold. If I miss a case, the code doesn't compile. It covers the classic two-sided Either<L, R> too, plus a few extras I use every day.

Smaller unions merge into bigger ones:

@Union(Circle::class, Square::class) 
interface ShapeSpec 

@Union(Int::class, ShapeSpec::class) 
interface ItemSpec   // Int, Circle or Square

My existing sealed classes get the same helpers:

@Derive 
sealed interface UiState { … } 

state.fold(onLoading = { … }, onSuccess = { … }, onError = { … })

And unions go in and out of JSON as plain values:

Json.encodeToString<Result>(Result(5))   // 5 Json.decodeFromString<Result>(""hi"")   // Result.OnString("hi")

Open source (MIT), available on maven central: https://github.com/fcat97/unionKt


r/KotlinMultiplatform • • Oct 29 '25

When to use .value vs .update in StateFlow?

Post image
0 Upvotes

I was confused about when to use _uiState.value = ... vs _uiState.update { ... }, so I put together this quick example 👇

💡 .value = → simple/static updates (e.g., Loading, Error) 💡 .update {} → safe, dependent updates (like incrementing a counter)

How do you handle this in your ViewModels?


r/KotlinMultiplatform • • Oct 28 '25

KMP+CMP OpenSource Boilerplate v0.3.0! Build apps in days

Thumbnail gallery
2 Upvotes

r/KotlinMultiplatform • • Oct 07 '25

Did you know “Share UI” is selected by default in new KMP projects? 🤔

1 Upvotes

Just noticed that Android Studio gives an option — “Share UI” or “Do Not Share UI” — when creating a Kotlin Multiplatform project, and “Share UI” is selected by default.

I’ve been learning KMP for a few months but somehow missed this until recently.
Did you spot it on your first try?


r/KotlinMultiplatform • • Aug 26 '24

KMP DI library?

0 Upvotes

Hey Kotlin devs, recently I started exploring Kotlin Multiplatform and while waiting for Dagger/Hilt/Anvil to go multiplatform I decided to build a small and lightweight DI container that we can use today.

Long story short, I evaluated Koin and Kodein (which both look good btw!), however, given how important DI is to an app... I needed something simple that I understand under the hood well. Honestly, I just had a bit different taste for the DI API, and reading all the docs was tiresome.

With that, I embarked on the journey of creating our own ~200 LoC DI container using just Kotlin. It turned out that it does everything we need (which is not much tbh) and decided to publish it as a library - "com.ivy-apps:di".

API overview:

```kotlin
class A
class B(val a: B)
class C(val a: A, val b: B) : InterfaceC
interface InterfaceC

Di.appScope {
autoWire(::A)
autoWireSingleton(::B)
autoWire(::C)
bind<InterfaceC, C>()
}

val c = Di.get<InterfaceC>() // C instance

```

If you're interested in KMP DI, feel free to have a look and lmk wdyt in the comments. If you like the project, you can drop a ⭐ on our GitHub repo to indicate your support and motivate future development.

https://github.com/Ivy-Apps/di


r/KotlinMultiplatform • • 10d ago

Kotlean: write Android apps in Lean

Thumbnail
github.com
1 Upvotes

r/KotlinMultiplatform • • Aug 20 '26

What are the trade-offs of KSP-generated validation in Kotlin?

0 Upvotes

We are experimenting with a KSP-based approach to Kotlin validation where validation logic is generated during compilation and then executed at runtime.

But we wonder what their view is on this matter:

  • What do you see as the biggest advantages of generated validation compared with reflection-based approaches?

  • Where do you think the added KSP/build-time complexity becomes a disadvantage?

  • What would you expect from a production-ready Kotlin validation library?

We are mainly interested in the technical discussion and criticism.

Repository: https://github.com/DeveloperSyndicate/Valix


r/KotlinMultiplatform • • Oct 08 '25

Gradle management in Kotlin Multiplatform + Compose Multiplatform

1 Upvotes

To be honest: If hell exists, its name should be Gradle 🔥 Let me explain why and my approach to survive 🫠

While working on my side project VocabKit (I am still developing but you can join email list or follow on social media) to sharpen my Kotlin Multiplatform + Compose Multiplatform skills, I realized something: managing multi-module Gradle files can quickly turn into chaos. 🌪️

Here’s how I simplified it step by step:

🧩 Image-A: Started with multiple gradle.kts files — each ~88 lines long 😬

💡 Image-B: Switched to Convention Plugins (thanks Android world!) → 43 lines

🚀 Image-C: Then improved it further → 14 lines per module!

Now my Gradle setup finally feels clean & maintainable 🙌

👉 I also shared the full story on Medium.

Curious to know: How do you manage Gradle in your multi-module KMP projects? Let’s share ideas! 💭


r/KotlinMultiplatform • • Aug 10 '26

13 Compose Mistakes That Are Still Killing Your App’s Performance in 2026 + Claude SKILL to Find Them

Thumbnail
reddit.com
0 Upvotes

r/KotlinMultiplatform • • Oct 19 '25

Managing Resources and Logo

Thumbnail reddit.com
0 Upvotes

r/KotlinMultiplatform • • 10d ago

# Seeking feedback: agentic architecture and agent harness for a mobile app with KMP shared logic, legacy UIKit/Android Views, and new SwiftUI/Compose UI

0 Upvotes

Hi everyone,

I’m working on a mobile application that contains both a legacy codebase and a newer Kotlin Multiplatform (KMP) architecture. I’m looking for feedback from people who have already introduced an agentic architecture or AI-assisted development workflows into a similar mobile project.

## Current architecture

- **Legacy part:**
- Legacy UI is implemented with UIKit on iOS and classic Android Views / XML layouts on Android.
- Legacy services are implemented natively in Swift for iOS and Kotlin for Android.

- **New KMP part:**
- Business logic, use cases, repositories, data sources, and ViewModels are shared in Kotlin Multiplatform.

- **New UI layer:**
- New screens are implemented with SwiftUI on iOS and Jetpack Compose on Android.
- Both platforms consume the shared KMP ViewModels.

So, the shared KMP layer covers domain/business logic through to the ViewModel, while the UI remains native on each platform. The legacy screens remain in UIKit on iOS and Android Views on Android, while new screens use SwiftUI and Compose.

## What I want to introduce

I want to introduce an **agentic architecture** to support development, code review, documentation, testing, and the progressive migration of legacy code into KMP.

I have access to both **GitHub Copilot** and **Claude**, and I’m looking for best practices to build a proper **agent harness** around them, rather than using them only as chat-based coding assistants.

By “agent harness”, I mean the surrounding system that makes agents reliable and useful in a real codebase:

- Structured project context and documentation
- Architecture rules and coding conventions
- Controlled access to repositories, files, and tools
- MCP integrations where relevant
- Task planning, delegation, and validation
- Test execution, static analysis, and review gates
- Guardrails around legacy UIKit and Android Views code
- Observability, feedback loops, and human approval for critical changes

The goal is not necessarily to create a fully autonomous agent that modifies the repository without supervision. I’m looking for a practical, controlled setup where agents can support analysis, planning, implementation, testing, documentation, and progressive migration, while developers remain responsible for architectural decisions, critical reviews, and production-facing changes.

## Questions

  1. How would you structure the agents?
    - One orchestrator agent plus specialised agents?
    - Domain-specific agents?
    - MCP tools?
    - Or a simpler deterministic workflow with AI-assisted steps?

  2. How would you design an agent harness using GitHub Copilot and Claude in a mobile KMP project?
    - Which responsibilities should be given to Copilot versus Claude?
    - Should Claude be used as the orchestrator/planner and Copilot for IDE-native implementation?
    - What MCP servers, tools, permissions, and validation steps would you expose?
    - How would you structure prompts, rules files, project documentation, and task workflows?
    - How would you prevent agents from modifying critical legacy UIKit or Android Views code without approval?

  3. What project context should be exposed to the agents?
    - Architecture documentation
    - KMP module map
    - Coding conventions
    - Legacy service inventory
    - Legacy UI inventory
    - API contracts
    - Test strategy
    - CI/CD information
    - ADRs / technical decision records

  4. For the legacy native Swift/Kotlin services and UIKit/Android Views screens, what strategy would you recommend?
    - Create an adapter layer in KMP
    - Expose legacy services through interfaces/ports
    - Migrate use cases progressively
    - Keep some services or screens native on purpose
    - Treat legacy UI as a protected area with stricter review rules

  5. What guardrails would you put in place?
    - Mandatory tests
    - Static analysis
    - Human review
    - Limited write permissions
    - Protected legacy areas
    - Approval gates before changes

  6. Has anyone used AI agents in a multi-module mobile repository with KMP, Xcode, Gradle, CI/CD, UIKit, Android Views, SwiftUI, and Compose?
    - What worked well?
    - What failed?
    - What would you do differently?

## My initial idea

I’m thinking of starting with a progressive approach:

- Create a structured project context: architecture docs, conventions, module map, migration rules, legacy inventory, and UI inventory.
- Define specialised agents:
- Architecture agent
- KMP/Kotlin agent
- iOS/SwiftUI agent
- Android/Compose agent
- Legacy iOS/UIKit agent
- Legacy Android/Views agent
- Testing agent
- Code review agent
- Documentation agent
- Use an orchestrator that receives a task, creates a plan, delegates work, and validates the result.
- Add guardrails: mandatory tests, static analysis, human approval, and restricted access to critical legacy code.

My assumption is that agents should not have unrestricted access to the whole repository from day one. They should work within a clearly defined scope, use verifiable tools, and follow repeatable workflows.

Any feedback, real-world experience, architecture examples, tooling recommendations, or pitfalls to avoid would be greatly appreciated.

Thanks!


r/KotlinMultiplatform • • Sep 20 '26

Kotlin Multiplatform KMP Coursera Course

0 Upvotes

Anyone has the code or material files for this course

https://www.coursera.org/learn/advance-kotlin-for-multi-platform-development


r/KotlinMultiplatform • • Jul 15 '26

KMP navigation that also knows about offline UI state — looking for multiplatform API feedback

2 Upvotes

Building shared UI for Android / iOS / desktop and I kept splitting “navigation” and “offline UX” into two messy layers:

• type-safe routes and backstack in commonMain

• optimistic updates + rollback when writes are local-first

• pending outbox / conflict / offline status on chrome (badges, banners) without copy-pasting per platform

• deep links + process-death restore that work the same on CMP

I open-sourced a small library for that (Compose Multiplatform + commonMain-first):

• sealed Serializable routes, multiplatform backstack

• ForgeNavHost (transitions; Android system/predictive back)

• MviViewModel with optimistic updates

• optional SyncFacade ports for sync-aware UI (not a sync engine itself)

• RouteCodec + rememberSaveableForgeNavigator for stack restore

• samples: Android, Desktop, iOS (CMP framework + SwiftUI host)

Companion idea: plug any outbox engine (we use SyncForge optionally) for real push/pull; nav/MVI work without it too.

Repo (Apache 2.0):

https://github.com/Arsenoal/forgenav

Curious how other KMP teams handle this:

  1. Do you share one NavHost model across Android + iOS, or platform navigators with shared ViewModels only?

  2. How do you model “pending / conflict” in common UI state without leaking platform sync details?

  3. Saved state / process death: custom codecs, or do you just accept “restart at root” on mobile?

  4. Anyone using Decompose / Voyager / official Navigation for the same offline-first UX — what hurt?

Looking for multiplatform API critique more than installs. Happy to discuss expect/actual surface and CMP lifecycle tradeoffs.


r/KotlinMultiplatform • • Aug 22 '26

Help.

0 Upvotes

Looking for a KMP remote role.

I have been working on native android applications..have 5 years of experience in the Fintech and lifestyle domain.

Currently working with KMP for past year . Also with ktor for BE on dummy project.

Need a full time role on KMP / CMP.

Willing to relocate to office later. But currently need a remote role.

Could someone please help.

https://github.com/RANZN

https://medium.com/@prakash_ranjan

Sharing links to give more about my work.


r/KotlinMultiplatform • • 5d ago

Another postmortem story of taking KMP into use in Solo project

Thumbnail clothie.app
5 Upvotes

I'm a solo developer and recently took KMP into use. The overall process took me around 4 months. Here's my four cents,

  • Where it all started: Around 80%+ of potential app users demanded an iPhone version.

  • The Strategy: I'm a Java developer by heart and Kotlin was my choice in the first place. Avoided learning Swift by leveraging Kotlin Multiplatform (KMP) and Compose Multiplatform (CMP), backed by a low-risk $0 hardware baseline (used Mac/iPhone) and a brief expert iOS architecture consultation.

  • Refactoring: Spent two weeks ruthlessly modularizing code (splitting into app, feature, and core layers) because KMP brutally punishes tight platform coupling.

  • Accelerated UI porting by feeding feature modules into LLMs, resulting in an "illusion of speed" where hollow state flows and broken layout measurements required a manual, screen-by-screen rewrite.

  • The Payoff: Achieved ~85-95% code sharing, zero context-switching between languages, and the operational leverage of a two-platform team as a solo builder. I'm ok with XCode although Android Studio with relevant plugins deals the same.

I pushed the whole story here,

https://clothie.app/blog/post.html?slug=how-a-solo-developer-traded-android


r/KotlinMultiplatform • • Jul 21 '26

Migrate KMP project to NUCLEUS FRAMEWORK or GraalVM

Thumbnail
gallery
3 Upvotes

Hello kmp developers, it's me again. I'm currently still adding features to my music player, but I feel that as the project grows, the performance cost might increase. I'm thinking about migrating to Nucleus Framework, but I'm not sure how feasible it is.

In my project, I implement a wide variety of things, such as: JNA, JNI, LibMPV, SqlDelight, and Reflexion in Innertube (module).

Has anyone used Nucleus or GraalVM before and could help me understand the migration process and how feasible it might be? I've seen some projects like https://github.com/terrakok/CozySpace, which works well with GraalVM, but how likely is it to work for me?

Some of the benefits are reduced RAM consumption and a faster boot time (something that interests me a lot).

my project: https://github.com/AndresTarma1/MusicApp


r/KotlinMultiplatform • • Aug 06 '26

Built an AI HR Assistant with Koog Framework + Kotlin Multiplatform (Android, iOS & Desktop)

1 Upvotes

I built a small AI HR Assistant to learn how AI agents work in a Kotlin Multiplatform app.

The app runs on Android, iOS, and Desktop from a single codebase. Ask a question in natural language, the AI chooses the right tool, fetches employee data from a Ktor backend, and returns the answer.

Things I learned while building it:

  • Defining AI tools (Tool<Args, Result>)

  • Building a ToolRegistry and AIAgent

  • Using KMP's expect/actual pattern to plug in platform-specific LLM runtimes (currently Ollama)

It's not production-ready yet (no auth or real HR workflows), but it's a good reference if you're exploring AI agents with Kotlin.

GitHub: https://github.com/livingstonantony/AI_Employee

Feedback and suggestions are always welcome!