Ive seen many people share code between iOS and Android, but have you ever considered doing so between jvm-desktop & Android?! Jokes aside, I used this approach because building with desktop was blazingly fast for me, and a superb way to test out the UX (no more slow emulators kodee loving). Feel free to check out the project on the play store here, or find some tech details in 🧵
➕ 7
Zoltan Demant
05/28/2024, 12:30 PM
Coming from my earlier Android specific projects, I took the opportunity to learn about some multiplatform libraries for this project! The goal is to support iOS as well very shortly (I just dont have any Apple devices in my arsenal yet 👼🏽).
Things that made life easier:
• SqlDelight for data storage
• Koin for dependency management
• Ktor for network stuff
• M3 for the UI
Some drawbacks:
• Redirect handling on desktop is not as simple as on Android and I couldnt find a good library for it.
• Compose multiplatform does not include a way to target alpha releases of M3.
• Firebase does not support multiplatform yet.
Awesomeness (random stuff I wasnt aware would work, but did):
• Screenshot generation with desktop is very neat (and fast).
• Sharing code between frontend & backend 🤌🏽
👍 3
d
darkmoon_uk
05/30/2024, 4:59 AM
Yes, we also use the Desktop target as a development tool. It's a testament to how easy KMP makes it to create a Desktop App; that you do it because it actually makes your life easier - adding a Desktop App is a netnegative effort - just consider that K!
kodee happy 4
g
Garret Yoder
05/30/2024, 2:29 PM
This has been my method since starting as well. Dev for the desktop target & just make your UI responsive to begin with.
If you make your UI properly responsive, resizing the window into a phone form factor should look identical to how it does on android and iOS.
kodee happy 2
s
Stefan Oltmann
06/07/2024, 2:50 PM
Be careful and test at least on emulator before releases.
I found that the zoom handlers behave differently on Desktop.
If you have two zoomgesture detectors on Desktop both get the events and everything is fine. On Android only the component at the bottom gets it and it will be consumed there.
So you can test drive most of the stuff as both targets will behave the same in 95% of the cases but not testing on an emulator (or real device) before releasing or even sending a PR is too risky.
z
Zoltan Demant
06/09/2024, 5:45 AM
Completely agreed, @Stefan Oltmann! I always make sure to run an internal release on my phone for a few days or a week before pushing to beta/production; love the peace of mind that it gives me 😄
Another benefit of using desktop, that I havent seen mentioned much: creating screenshots! Its amazingly fast, and I feel that after all these years I can finally create new screenshots without it being a burden. Even the screenshot for this post is made thansk to that!