r/Kotlin • • 23h ago

KotlinConf Black Friday: 35% off conference passes + 10% off workshop add-ons

Post image
6 Upvotes

Hey folks! Our Black Friday offer is live: 35% off conference passes and 10% off workshop add-ons. Get tickets by Sunday, November 29, 23:59 CET.

Join us in Kraków on April 21–23, 2027 for our annual full-stack conference. Meet professional developers from around the world and the team behind Kotlin, exchange ideas, and celebrate together!

The CfP closes November 27; volunteer applications are open until December 21.

Any questions? Happy to answer here.


r/Kotlin • • 1d ago

Kotlin Benchmark 2.0: How AI Coding Agents Handle Harder Tasks and Closed-Source Code

Thumbnail blog.jetbrains.com
23 Upvotes

r/Kotlin • • 1d ago

Gradle Compatibility Timeline

Thumbnail helpermethod.github.io
1 Upvotes

Slapped/slopped this together in an afternoon to see at a glance which Gradle version is compatible with which Java/Kotlin version. Thought it might be helpful to others.


r/Kotlin • • 1d ago

Built an offline-first RSS reader with Clean Architecture, Room, and Supabase looking for honest technical feedback

Thumbnail reddit.com
0 Upvotes

r/Kotlin • • 2d ago

Can the Kotlin types I use (List, data class) affect how often Compose recomposes?

3 Upvotes

I'm new to Compose and trying to understand recomposition. I've noticed that my screen state is a data class with a List inside it and I'm wondering if the type of collection matters for how Compose decides to redraw. Does it matter whether I use List a data class or something else? Or is that over-thinking it at my level?


r/Kotlin • • 2d ago

Dropping Material: a small custom design system in Jetpack Compose, using only CompositionLocals

1 Upvotes

I wanted my app to stop looking like every other Material 3 app, so I removed material3 entirely. The app depends only on runtime, ui, foundation and animation. The whole theme is about 420 lines of Kotlin. Here's how it fits together.

1. Tokens are plain u/Immutable data classes

The tokens are named by role rather than by Material slots like primary and surface:

data class SignalColors(
    val isDark: Boolean,
    val paper: Color,     // background
    val ink: Color,       // primary text
    val download: Color,
    val upload: Color,
    val warning: Color,   // only used for an over-budget forecast
    // …
)

The same pattern covers type, spacing, shapes and motion. Light and dark themes are just two instances.

2. One static CompositionLocal per token group

val LocalSignalColors = staticCompositionLocalOf { LightSignalColors }

object Signal {
    val colors: SignalColors
         u/ReadOnlyComposable get() = LocalSignalColors.current
}

Call sites read Signal.colors.ink or Signal.type.body, which looks like MaterialTheme with none of its baggage. I used staticCompositionLocalOf because these values almost never change, so a change recomposing the whole tree is acceptable.

3. A replacement for the ripple

Removing Material also removes the ripple, so I wrote an IndicationNodeFactory that draws a 10% ink wash over the pressed element. It's a Modifier.Node that collects PressInteractions and animates its alpha. It's provided once as LocalIndication, so every clickable uses it automatically.

4. One variable font, roles fixed in code

Mona Sans is a single variable font. FontFamily only resolves fonts by weight, so each type role is built as its own family, with width and optical size set in that family's FontVariation.Settings. Numbers use the wide width, body text the normal width, and the status-bar icon the condensed width.

5. Motion that follows accessibility settings

Motion tokens are tween specs. Compose already scales animation durations by the system animator scale. For animation it can't scale (a chart that scrolls continuously), a ContentObserver watches ANIMATOR_DURATION_SCALE and sets a reduced flag.

6. Plain JVM tests for the palette

A tiny WCAG contrast helper runs in ordinary JUnit tests, so a colour change that fails contrast also fails the build. No emulator is needed.


r/Kotlin • • 2d ago

Made a launch video for our Multiplatform app, would love feedback

1 Upvotes

Hey everyone!

In April I posted a retrospective on how we built iShape, a nutrition app, using 100% Kotlin: two people, 93% shared mobile code with CMP, a Ktor backend and a Koog AI pipeline. JetBrains much?! And they kindly shared it on their X! 😄

Since then, we've rebuilt our AI agent, and I made a launch video for it on my own by hand and poured a lot of time and love into it, so seeing it finally out in the world feels really special.

Lee, our AI nutrition coach knows your day, every meal you log, your goals, your activities, and much more. You can log your day in one messy text message, or through image (which we worked really hard and benchmarked on a bunch of real weighed meals - but I won't spoil the video for you 🫣). Our approach is getting every food through a real food database, so we're leaving the guessing game behind as much as possible.

Launch video: https://youtu.be/t-pPedDwbo8
Original X post: https://x.com/kotlin/status/2049764780433437104

Would love to hear your honest opinions about the video 🙏


r/Kotlin • • 2d ago

Stos - an open-source, Stack Exchange client built with Kotlin Multiplatform

Thumbnail reddit.com
2 Upvotes

r/Kotlin • • 2d ago

Exploring Kotlin static analysis inside an IntelliJ Platform plugin using UAST

2 Upvotes

I've been exploring static code analysis for Android projects while building an IntelliJ-based developer tool.

One interesting challenge has been identifying potential lifecycle and memory-related issues by analyzing Kotlin source code rather than relying entirely on runtime heap analysis.

For example, consider patterns such as:

  • A singleton retaining an Activity or Fragment reference.
  • Coroutine scopes that outlive the lifecycle of the component that launched them.
  • Long-lived callbacks retaining UI-related objects.
  • Incorrect ownership of objects across lifecycle boundaries.

The tricky part is that detecting these patterns reliably isn't always straightforward.

Kotlin introduces several language features that make source analysis interesting: extension functions, lambdas, inline functions, delegated properties, higher-order functions, and coroutine scopes.

I've been experimenting with UAST-based inspections to analyze these patterns within the IntelliJ Platform.

A few questions for Kotlin developers who have worked on static analysis:

  1. How do you approach analyzing Kotlin-specific language constructs when building inspections?
  2. Do you prefer PSI directly, UAST, or a combination of both for Kotlin analysis?
  3. How do you handle false positives when detecting lifecycle or object-retention patterns through source code?
  4. Are there Kotlin compiler APIs or analysis tools you'd recommend exploring for this kind of work?

I'm particularly interested in approaches that go beyond simple syntax matching and can reason about object ownership and lifecycle relationships.


r/Kotlin • • 4d ago

I taught a neural network to play Flappy Bird with pure Kotlin and Swing

Post image
3 Upvotes

r/Kotlin • • 3d ago

I built a modern terminal in Kotlin: Meet KetraTerm

Thumbnail gallery
0 Upvotes

Hey everyone!

I've just released KetraTerm 1.0, an open-source terminal emulator written in Kotlin.

KetraTerm is a fast, modern terminal with its own JVM-native engine and a custom Swing renderer. It's designed for everyday shell usage as well as demanding terminal applications.

It supports Kitty keyboard, Kitty graphics with image rendering, Unicode 17 graphemes, TrueColor, modern underline styles, hyperlinks, synchronized output, and more.

Besides supporting modern terminal applications, I've been working on features that make everyday terminal usage more convenient:

  • Smart suggestions: Complete commands, arguments, paths, and Git branches. The suggestions engine can also learn from successfully executed commands and your usage to improve future results.
  • Sticky command headers: Keep the command that produced an output visible while scrolling through it.
  • Command navigation: Jump between commands, select entire command blocks, and copy their output.
  • Customizable prompts: Choose between gutters and dividers, with visual indicators for failed commands.
  • Notifications and progress: Get alerts when long-running commands finish, along with terminal notifications and progress indicators.

I've also put a lot of effort into responsiveness and keeping memory allocations low.

It's available as a desktop terminal for Windows, macOS, and Linux, a JetBrains IDE plugin, and reusable Kotlin/JVM libraries.

The project is open source under the Apache 2.0 license, and I'm continuing to improve compatibility, performance, and the overall user experience.

Contributions are very welcome! Whether you're interested in terminal protocols, performance optimizations, UI improvements, or documentation, feel free to open an issue or submit a PR.

I'd really appreciate feedback, especially from people using complex TUIs or coding agents. I'm also interested in hearing what features you find useful in your current terminal and what you'd like to see improved!

Website / Downloads: https://ketraterm.github.io/KetraTerm/

GitHub: https://github.com/ketraterm/KetraTerm

JetBrains plugin: https://plugins.jetbrains.com/plugin/32589-ketraterm/


r/Kotlin • • 5d ago

Working on Yalın, a Rust-based JSON parser for Kotlin/Android

Post image
35 Upvotes

I'm working on a JSON parser for Android called Yalın. The core is written in Rust, with a Kotlin/Java API.

It uses ARM NEON SIMD, and I've been trying to keep JNI overhead as low as possible.

In my benchmarks against fastjson2, selective field reads are up to 4.6x faster, while parsing a full 1 MB JSON tree is around 1.3x faster.

Still working on performance, especially for smaller payloads where JNI overhead becomes an issue.

Would be interested in feedback from Kotlin developers, particularly on the API design.

https://github.com/0xberkay/yalin


r/Kotlin • • 6d ago

Compose Fast Scrollbar: a draggable scrollbar for lazy lists in Compose Multiplatform

Post image
14 Upvotes

Hi r/Kotlin, I created a CMP scrollbar with an easy-to-use API.

Compose has no draggable scrollbar for lazy lists on Android or iOS (desktop has one, but it's desktop-only). I wanted one in shared UI, so I made a library for it.

LazyColumn(
    state = listState,
    modifier = Modifier.scrollbar(listState),
) { ... }

One modifier in commonMain, works on Android, iOS and desktop:

→ LazyColumn, LazyRow and both lazy grids

→ label bubble while dragging (month, letter, section)

→ handles infinite feeds: pages loading mid-drag keep the thumb under your finger

→ no recompositions while scrolling or dragging

→ per-platform styles from shared code, no expect/actual needed

I published it on Maven Central, and it needs Compose Multiplatform 1.10+.

GitHub: https://github.com/Amaanprobably/compose-fast-scrollbar

I also wrote an easy-to-follow guide with short videos: https://github.com/Amaanprobably/compose-fast-scrollbar/blob/master/GUIDE.md

It's my first library, so feedback is welcome, especially from anyone building with KMP/CMP.


r/Kotlin • • 5d ago

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

0 Upvotes

Sebastian Aigner (u/sebi_io) made a 3-minute demo showing how an AI coding agent can use the Kotlin Toolchain to build and ship a Kotlin Multiplatform app. He walks through the workflow, from creating the project to publishing it to TestFlight.

If you haven't looked at it yet: The Kotlin Toolchain is a unified entry point into Kotlin, with a single CLI, a declarative project configuration, and build tooling included. It is open source and in Alpha.

Along the way, Sebastian adds a map and Liquid Glass styling to make parts of the app look native on iOS.

What do you think about this workflow?


r/Kotlin • • 7d ago

DevView Library

6 Upvotes

Hi everyone! I wanted to share DevView, a Kotlin Multiplatform library that adds a developer overlay to your Android and iOS apps.

It brings a few debugging tools directly into the app:

- Toggle feature flags and override remote-config values.

- Inspect analytics events as you navigate.

- Mock API responses from OpenAPI specs through a Ktor plugin.

- View console logs on the device.

- Record and restore the current screen’s state with TimeCapsule.

You register only the modules you need, and you can add your own tools. It’s built with Compose Multiplatform, available on Maven Central, and open source under Apache 2.0.

If you’re working on a KMP app, try adding one module to your debug build. I’d love feedback on the setup and which tools would be useful in your day-to-day work.

Docs and setup: https://worldline.github.io/devview/


r/Kotlin • • 8d ago

Kotlin Coroutines: Full 4-Hour Course

Thumbnail youtu.be
119 Upvotes

r/Kotlin • • 7d ago

Peephole, an open-source network inspector for Android Studio

Thumbnail reddit.com
3 Upvotes

r/Kotlin • • 7d ago

One Kotlin codebase on Android, iPhone, iPad and the browser: three things that caught me out

5 Upvotes

I have taken a small word game, WordEke, from an Android-only Kotlin and Jetpack Compose app to the same code running on Android, iPhone, iPad and the web (Kotlin 2.3.21, Compose Multiplatform 1.11.1). The game logic is a pure Kotlin module in commonMain and the UI is one Compose Multiplatform module. Three things were not in the tutorials.

1. Kotlin/Wasm does not run on older iPads. It needs WebAssembly garbage collection and exception handling, which Safari gained in 18.2, and every browser on an iPad is Safari underneath. iPads that stop at iPadOS 17 sat on "Loading" forever, with no error. I added a js target beside wasmJs, with the web code in a source set the two share, and the page now probes the browser and loads whichever build it can run. None of the web code had to change.

2. Fixed script names and long caching do not mix. My server caches .js for years. The generated script had a fixed name but referenced .wasm files named by content, so a deploy that replaced the folder left returning players holding a script that requested files that were gone. The scripts are now named by content too, and a deploy adds to the folder instead of replacing it.

3. A high iOS minimum hid a warning instead of fixing it. I had set the minimum to iOS 18.5 because it silenced a linker warning: Skia's ICU data object is built for 18.5. Dropping to 17.0 to reach those older iPads brought the warning back. It is data, not code, and everything passes on current simulators, but Xcode would not download an iOS 17 simulator for me, so the app is still untested on 17 itself. A refurbished 2018 iPad is on its way to settle it.

You can see the result at https://wordeke.com, where the browser version needs no install or account. Happy to go into detail on any of this, and I would like to hear from anyone with a cleaner way to serve Wasm with a JavaScript fallback.

Updates and feedback on the game itself: r/wordeke


r/Kotlin • • 7d ago

kUML v0.58.0 — steerable note placement (SVG and LaTeX/TikZ), layout hints per group, general class on top in UML class diagrams

Thumbnail gallery
0 Upvotes

kUML is a Kotlin DSL and toolchain for UML, SysML 2, C4, BPMN and more. Highlights of this release:

  • Note placement: a note's placement hint (ABOVE, BELOW, LEFT, RIGHT, NEAR) is honoured in UML, C4, SysML 2, ERM, sequence diagrams, BPMN annotations and Service Blueprint, in SVG and in the LaTeX/TikZ export of UML, C4, SysML 2, BPMN and Service Blueprint. Not covered by LaTeX: UML sequence, ERM and the SysML 2 sequence fallback; in the BPMN process view hints are honoured only outside the flow. An unmet hint falls back to the default position with KUML-NOTE-W004. Anchor lines of notes in Service Blueprint and sequence diagrams are drawn; note tone colours can be overridden per theme.
  • Hierarchical layout per group: boundaryDirection gives a self-contained C4 boundary its own flow direction (container and component diagrams, only when no relationship crosses the boundary; otherwise KUML-LAYOUT-W009). wrapColumns, sameLayer, first, last work inside UML package diagrams whose members have no relationship crossing the package border and no nested packages. Default output without hints is unchanged.
  • Honest reporting: wrapColumns/sameLayer on members of other compound groups (C4 boundary, package/node/frame in class, component, deployment, state, SysML 2 package diagrams) are now reported as KUML-LAYOUT-W001 instead of being dropped silently. Hub edges of block definition diagrams are drawn as an orthogonal fan.
  • Behaviour change: in UML class diagrams the general class of a generalisation is now drawn above its specialisations by default (before, below), so existing diagrams can look different.
  • Breaking for JS/Wasm consumers: dev.kuml:*-js and *-wasm-js artifacts are no longer published to Maven Central (a release shrinks from about 2,880 to about 2,200 files).
  • Windows: the kUML Desktop MSI is part of this release with the real version 0.58.0. Anyone who installed an earlier MSI (shown as 56.0.0) has to uninstall it once. The MSI is not code-signed, so SmartScreen may show a warning; WinGet and Chocolatey packages follow after the release.

Repo: https://github.com/kuml-dev/kUML · What's new: https://kuml.dev/whats-new · Release notes: https://github.com/kuml-dev/kUML/releases/tag/v0.58.0


r/Kotlin • • 7d ago

I am trying to make my first app with navigation buttons in Jetpack Compose, is my understanding correct? (inside Android Studio)

Thumbnail reddit.com
1 Upvotes

r/Kotlin • • 7d ago

DevView Library

Thumbnail reddit.com
1 Upvotes

r/Kotlin • • 8d ago

Kotlin Toolchain 0.14: The Technical Highlights (iOS App Publishing, Android Desugaring, Incremental Fixes)

Thumbnail reddit.com
10 Upvotes

r/Kotlin • • 9d ago

Decorating a function property in a data class with copy(): gotchas I'm missing?

6 Upvotes

I have a few hundred calculator definitions in a side project (an Android study app), each one a data class with a function property:

data class CalculatorDefinition(
    val id: String,
    val inputs: List<CalculatorInput> = emptyList(),
    // ...lots of metadata...
    val calculate: (Map<String, Any?>) -> CalculationResult = { CalculationResult("") }
)

To add input range checks to every calculator without touching each definition, I wrap the lambda once when the registry is built:

fun withRangeValidation(def: CalculatorDefinition): CalculatorDefinition {
    val original = def.calculate
    return def.copy(calculate = { values ->
        val problems = InputValidator.validate(def, values)
        if (problems.isNotEmpty()) CalculationResult("—", isSuccess = false, errorMessage = problems.joinToString("\n"))
        else original(values)
    })
}

It works, but a few things bother me:

  1. equals() and hashCode() now include a lambda, so two definitions with identical data are never equal after wrapping. Is moving the function out of the primary constructor the usual fix?
  2. The wrapper captures the pre-copy instance. Harmless here because validation only reads the inputs, but it feels like a trap if someone later changes the inputs with another copy().
  3. Nothing stops the same definition being wrapped twice. Right now the registry object builds the list once, so it doesn't happen, but it isn't enforced.

Would you keep this as a decorator over the data class, or split it into a plain data class for the metadata plus a separate fun interface for the calculation? Curious how others structure this when there are hundreds of entries.


r/Kotlin • • 8d ago

Do you start with implementing the UI Design or the business logic layer?

Thumbnail reddit.com
0 Upvotes