I'm trying to figure out which tools work well wit...
# multiplatform
r
I'm trying to figure out which tools work well with KMM and haven't found any clear answers. Do these tools work well with KMM? • Android Jetpack • Dependency injection (Koin?) Or, do they cause significant problems with KMM? And if they do, what tools are recommended for similar purposes?
p
Jetpack isn’t a tool, it’s a namespace for a ton of libraries. Of which none has multiplatform support iirc. For di there is kotlin-inject; koin is rather a service locator
☝️ 2
r
If I use Android Jetpack libraries for the Android portion, does that work well? Or are there other things that would fill that role but in a more multiplatform-friendly way?
p
Yeah sure, on the android side you can use android things
p
Koin works fine on KMM btw.
👍 1
☝️ 1
r
Regarding Android Jetpack, my main concern there is making sure that everything which can be written with shared code is written with shared code. I don't want to unnecessarily involve android-specific tools when it could be done in a general way
p
You should not be thinking about jetpack, that’s really just a namespace. Think about a specific problem you want to solve
👆 2
m
It's all about how much you share. Let's say ideally you would like to share as much as possible. In that case you will come across a problem that you currently solve with Android specific library ( like the Jetpack one's ). You will have to make a decision whether to use: 1. platform specific solution wrapped with interface that can be used in shared code ( good example is https://github.com/russhwolf/multiplatform-settings where you can still use something like Jetpack Datastore ) 2. new solution that is written as multiplatform ( e.g. https://github.com/cashapp/sqldelight instead of Jetpack Room )
🙌 1
c
Yeah. The nice part about KMM is that its all about how much you share. All of "jetpack"/androidx will work because you can just use it in android land and no one kmm apps will care.
👍 1
k
@Colton Idle How is the performance on iOS for shared code? Any weird bugs on iOS?
c
I'm doing it only for personal projects and so can't speak too much about it. but I like to be able to share my network code and some business logic.
k
@Colton Idle plus data layer using SQL Delight. Not that much sure about wrappers like settings. Having to share Data, Network, Business logic is huge time saver, you can even share test resources : https://developer.squareup.com/blog/kotlin-multiplatform-shared-test-resources/