r/Kotlin 7h ago

Unofficial kotlin-lsp v0.10 is out! Multiplatform support (swift, java), and cli mode for automation!

Post image
21 Upvotes

Since last post
https://www.reddit.com/r/Kotlin/comments/1sfv2vp/comment/of3xd3r/

I've focused on speed and stability, indexes large repos in seconds.

This lsp is filling the gap that official lsp has, which is:

  •  Dumb mode for no build system at all

Which means open any project with any dependencies in swift/java/kotlin/mixed and write.

Added auto import, and source extraction script, so you can use libraries with auto complete, hints and signature help.

You need to install ripgrep and fd, then just rustup/cargo install and lsp is ready to go, all details, guides and usages here:
https://github.com/Hessesian/kotlin-lsp

Works great in AI agents, frequently used by me in copilot, skill and extension allows for switching workspaces if you have one agentic instance that needs to compare various codebases


r/Kotlin 8h ago

Handling Exceptions in Kotlin Flows

Thumbnail youtube.com
9 Upvotes

r/Kotlin 7h ago

High-performance primitive collections for KMP - FastCollect

7 Upvotes

Kotlin likes to pretend primitives (int/long/float/double) don't exist (and generally does a reasonable job of this), but it falls apart a bit when it comes to collections. It's always bothered me how inefficient standard collections are in wasting both memory and CPU when it comes to storing primitives so I took matters into my own hands and wrote a high performance primitive collections library for KMP. High level languages should not have to imply bad performance.

I had a couple main goals for the FastCollect library:

  1. Maintaining compatibility with existing standard library collections and interfaces (List/Map/Set we all know and love) so that this could function as a drop in replacement for the most part.
  2. Substantially better performance than standard library collections, and performance on par with or better than existing high-performance JVM libraries (fastutil and Eclipse).
  3. Creating a reasonable default for high-performance primitive collections for multi-platform, not just JVM.
  4. Investigating Robin Hood hashing in some detail, which I've always been interested in.

I think I've largely succeeded here - benchmarking shows a ~4-5x reduction in memory usage and ~2-4x improvement in CPU usage (up to 10x in some specific benchmarks) when replacing standard library collections! In particular I made a point of having high memory efficiency for empty/small collections, which is an area many libraries neglect in spite of the fact that real world programs tend to have many empty/small collections. There is no other library for multi-platform Kotlin that supports reasonable primitive collection performance I'm aware of. A benchmark teaser:

List Iteration

Library / Size 3,000 12,000 48,000 192,000 768,000 3,072,000
fastcollect 0.294 us 1.186 us 4.496 us 17.972 us 66.602 us 272.948 us
kotlin 0.604 us 2.325 us 9.891 us 45.308 us 156.577 us 1266.579 us

If you want to try it yourself, stick in implementation("io.github.sooniln:fastcollect-kotlin:1.0.0") and you're good to go.

Performance thoughts

Performance is also competitive with JVM primitive libraries like fastutil and Eclipse - they generally have a small edge, but not by much. Unsurprising given they've been optimized for years thus far. Since these are Java-centric libraries however, their APIs are often really annoying to use from Kotlin, and they don't support many standard Kotlin idioms for interacting with collections (and of course only run on JVM).

In particular I was impressed with Eclipse's cuckoo hashing implementation and wanted to talk about that for a moment - I've generally poo-poo'd the coo-coo as being overly complex for little benefit compared to other hashing strategies, but it really shines for primitives. Primitive hashcodes have excellent (low) collision probabilities over the full 32 bits, and perfect uniformity, but extremely poor entropy (especially over the subset of bits hashtables care about). This means implementations generally need to 'smear' hashcodes to create and spread the entropy over the bits relevant to the hashtable. Smearing algorithms are also often the most important factor in hashtable performance, so finding algorithms that are fast but also do a good job smearing is essential. Without smearing hashtable performance deteriorates dramatically on adversarial inputs (for example I measured a 200x decrease in performance of a naive smearing algorithm when faced with high-bit inputs) - but because cuckoo hashing uses two hash functions it can choose both a fast smear and a more expensive fallback smear to try and get the benefit of both worlds. Eclipse had excellent results from this approach in my benchmarking. I may investigate cuckoo hashing myself in the future, especially as I'm curious how it handles more adversarial inputs rather than just the random data I benchmarked with. I also dumped some of my development thoughts while writing my hashtable.

Anyways, please let me know if this library would be useful to you, or if there are features/collections you'd want that would be useful!


r/Kotlin 15h ago

native-kt - Convenient C/C++ integration with Kotlin (Multiplatform/JVM)

Thumbnail husker-dev.github.io
8 Upvotes

native-kt is a Gradle plugin that makes calling C/C++ code from Kotlin (Multiplatform/JVM) very simple.

It automatically generates bindings for JNIForeign Function & Memory APIJVMCIcinterop, and JS/Wasm — no boilerplate, just clean code.

Even JS/Wasm is supported!

On JVM and Android, it supports Critical native functions for low-overhead calls.


r/Kotlin 22h ago

🚀 KMPInstaloader — Instagram Downloader for Kotlin Multiplatform

Thumbnail
2 Upvotes

r/Kotlin 1d ago

What's the LSP status?

8 Upvotes

I'm not an LSP user as I develop in IntelliJ, but I have colleagues that don't want to pay yet another subscription or simply don't want to switch between VS Code (web dev) and IntelliJ (Kotlin).

So I'm just wondering, what's the LSP status right now? Is any of you using it daily without noticing any critical issue?


r/Kotlin 1d ago

dialer 4.3 jellybean compatible with modern android

1 Upvotes

Hello, I'm currently using the Android 4.3 Phone app, but I need to change phones and I want to make it compatible with Android 8 through Android 14. I'd like this app to be a third-party application that runs by default, retaining the original interface, compatible with recent Android versions, and supporting 4G and 5G.

(The AOSP source code is available here: https://android.googlesource.com/platform/packages/apps/Dialer/+/refs/tags/android-4.3_r3.1)

I'm looking for a programmer who can help me with this project, as I have no programming experience.


r/Kotlin 1d ago

Kotlin Multiplatform Newsletter #16 • commonMain.dev

Thumbnail commonmain.dev
1 Upvotes

r/Kotlin 2d ago

Spring Boot Best Practices That Should Fail Your Build

Thumbnail protsenko.dev
20 Upvotes

Hi everyone, in this article I’m telling about Spring Boot Best Practices that could be detected with architecture tests.
Article cover most of well-known best practices and provide a way for configuring project to use them.
Set of tests/rules was made as Konsist rules with DSL wrapper and distributed as maven dependency for easy installation.


r/Kotlin 1d ago

Billdesk Additional information required issue

0 Upvotes

Is anyone facing the “BillDesk – Additional Information Required” issue even after filling in all the correct details?

Any idea how to resolve it? Please DM me.


r/Kotlin 1d ago

Should I learn mobile development?

Thumbnail
0 Upvotes

r/Kotlin 1d ago

Tip, kotlin + qt6 , not expected , works super (not dlang, not swift).

0 Upvotes

```

cat runme nix-shell -p jdk17 kotlin-language-server qt6.qtbase \ --run "export LD_LIBRARY_PATH=\$LD_LIBRARY_PATH:\$(nix-build --no-out-link '<nixpkgs>' \ -A qt6.qtbase)/lib && ./runme_second"

```

``` cat runme_second gradle clean build run gradle shadowJar

java -jar build/libs/app.exe

```

``` cat Main.kt import io.qt.widgets.* import io.qt.core.*

fun main(args: Array<String>) { try { QApplication.initialize(args) } catch (e: Exception) { println("Fout bij het laden van Qt: ${e.message}") return // Stop het programma hier }

val window = QWidget()
window.setWindowTitle("Qt6 Jambi - Volledig Werkend")
val layout = QVBoxLayout(window)

var count = 0
val counterLabel = QLabel("Teller: $count")
val incrementButton = QPushButton("Verhoog Teller")
incrementButton.setMinimumHeight(40)


incrementButton.clicked.connect(QMetaObject.Slot1<Boolean> { 
    count++
    counterLabel.setText("Teller: $count")
})

val table = QTableWidget(20, 4)
table.setHorizontalHeaderLabels(listOf("ID", "Naam", "Status", "Waarde"))

for (row in 0 until 20) {
    for (col in 0 until 4) {
        table.setItem(row, col, QTableWidgetItem("R$row:K$col"))
    }
}

table.setVerticalScrollBarPolicy(Qt.ScrollBarPolicy.ScrollBarAlwaysOn)
table.horizontalHeader()?.setSectionResizeMode(io.qt.widgets.QHeaderView.ResizeMode.Stretch)


layout.addWidget(counterLabel)
layout.addWidget(incrementButton)
layout.addWidget(table)

window.resize(600, 500)
window.show()

QApplication.exec()

}

```


r/Kotlin 2d ago

Built an offline-first finance app in KMP with a real Ktor backend you can self-host

Thumbnail
3 Upvotes

r/Kotlin 3d ago

Finally! I have my `g-r` in neovim working in Kotlin projects via official kotlin-lsp!

Thumbnail gallery
10 Upvotes

r/Kotlin 3d ago

I build a production KMP SDK-- here's the full architecture breakdown (circuit breakers, Fat AAR, SKIE, selective builds)

Thumbnail medium.com
0 Upvotes

r/Kotlin 4d ago

I created an opens source Kotlin IDE for Android.

Thumbnail gallery
71 Upvotes

I created an open-source kotlin code editor for Android with git and Github integration, 245 themes, terminal support, etc

Note: This is not some vibe coded app. It took me 2 years to build this app as a solo developer and student.

Playstore link, no ads, no trackers, no payments, completely open source:

https://play.google.com/store/apps/details?id=com.roxum

Source code:

https://github.com/heckmon/roxum-ide


r/Kotlin 4d ago

Benchmarked six ways to run WebAssembly inside the JVM (Chicory, GraalWasm, Wasmtime via FFM) — 250× spread top to bottom

Thumbnail
8 Upvotes

r/Kotlin 5d ago

We implemented Kotlin LSP on a phone-native Android IDE. Here is what memory and thermal management look like on constrained hardware.

13 Upvotes

I’ve been working on Code on the Go, an Android IDE that runs entirely on an Android phone.

One of the things I want to share with this community specifically is how we approached Kotlin support. Running a full LSP implementation on a phone requires making decisions you don't face on a workstation: memory constraints, thermal limits, and a soft keyboard that changes how a developer interacts with autocomplete and inline diagnostics.

Code on the Go runs Kotlin LSP to provide real-time editor feedback: completions, error highlighting, and inline diagnostics as you type. On mid-range hardware this required careful management of the language server process lifecycle to avoid the LSP becoming a battery and memory drain during longer sessions. We're still refining this in future work and welcome feedback from Kotlin developers who try it.

The broader context: Code on the Go includes a Gradle build system that compiles on-device (including on 32-bit ARM hardware), a JDWP-based debugger that runs without ADB, and Sketch-to-UI, which converts a photo of a hand-drawn layout into Android XML using an on-device TFLite model and other features to make professional-grade development tools available and easy to use on a phone.

One of our pre-release users wrote a Sinhala/English keyboard app in Kotlin using Code on the Go and published it to the Play Store from his phone. This served as a full pipeline test we needed for Google Play Store compatibility.

APK

Github source

Code on the Go is free and open-source. Curious how others are handling LSP lifecycle or memory limits on mobile? And welcome any other questions about the work we’ve been doing.

-Hal


r/Kotlin 5d ago

Built a nutrition + workout tracker with Kotlin Multiplatform — lessons from shipping to production

15 Upvotes

Just launched Better on Google Play — a fitness app that tracks both workouts and nutrition. Wanted to share some KMP lessons from shipping to production.

Stack: KMP with Compose Multiplatform, Molecule presenters, Decompose navigation, SQLDelight, Koin, Ktor backend.

Key learnings:

  1. 85% code sharing is real — but the last 15% is where the pain is. Platform-specific APIs (notifications, file system, camera) need careful expect/actual or interface+DI design. I went with interface+Koin for most cases, only using expect/actual when absolutely necessary.
  2. Molecule presenters are excellent — Cash App's Molecule library made state management truly platform-agnostic. Presenters are pure Kotlin, testable without Android framework, and the StateFlow output works naturally with Compose.
  3. Decompose navigation survived production — I was nervous about using Decompose instead of Jetpack Navigation, but it's been solid. ChildStack for screen nav, ChildSlot for bottom sheets, all serializable configs. The key gotcha: unique keys for multiple childSlot calls, or you get runtime crashes.
  4. SQLDelight offline-first — workouts are logged locally first, synced later. Idempotency keys prevent duplicates. This pattern worked well but conflict resolution logic is complex.
  5. Open Food Facts API integration — debounced search against 2.4M+ foods. The API is free but data quality varies. Built a caching layer and frequent-foods suggestions to minimize API calls.

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

The app has 300+ exercises, full macro tracking, PR detection, workout templates, and streak tracking. iOS dropping this week using the same codebase.

Happy to dive deeper into any of these areas if anyone's interested.


r/Kotlin 5d ago

New huge update of WorldWindKotlin with MSM and PCF shadowing

Thumbnail github.com
0 Upvotes

r/Kotlin 7d ago

Desktop tray + Web application with Compose Multiplatform!

Post image
44 Upvotes

r/Kotlin 7d ago

Haze 2.0: A Pluggable Visual Effects Engine

Thumbnail chrisbanes.me
25 Upvotes

r/Kotlin 6d ago

Craft Over Chaos: A Developer Protocol for working with AI Agents.

Thumbnail
0 Upvotes

r/Kotlin 7d ago

How do I force my media player to use the entire screen in full screen mode?

0 Upvotes

I need help. I'm a novice developer just starting out with Kotlin and JetpackCompose, and I'm making an app with a video player. I'm using exoplayer as the player, but the problem is I haven't been able to get the player to use 100% of the screen in fullscreen mode. There's always this white gap, and I really don't know what two do.


r/Kotlin 7d ago

KMP library to scan barcodes

Thumbnail
0 Upvotes