https://kotlinlang.org logo
#multiplatform
Title
# multiplatform
k

Ky

03/01/2021, 3:54 PM
Hey guys, one of my side projects is an android twitter app using jetpack compose. At some point I decided to just create a library for the new Twitter V2 api, I’m using retrofit and OKHTTP for networking but since I’ve started digging into iOS development I’ve decided I want the library to also be accessible for iOS. Looking at the Ktor docs, it seems pretty straight forward to create some common networking code and platform specific implementations for the things that cannot be shared. Does it make sense to take advantage of KMM here? I think it does, but most of the examples I see around are of KMM applications, all the code is in a single project and not really any ‘libraries’ . I want to provide a library which another person could leverage to create either an Android, iOS or even a KMM app if they wanted to. Thanks
k

Kris Wong

03/01/2021, 4:17 PM
yes, it makes sense to use KMM to create libraries
👍 1
even in the shared source repos the KMM component is a separate module (a library)
🙏 1
p

ptsiogas

03/02/2021, 12:41 PM
@Kris Wong I suppose that @Ky wants to create an SDK with KMM and then be able to share it though a framework or aar file to apps that want to implement it. I suppose in this case you need “fat” aar & framework. Am I right?
k

Kris Wong

03/02/2021, 2:34 PM
no, this is why we have dependency managers.
👍🏼 1
👍 1
Maven & Cocoapods to be specific
p

ptsiogas

03/02/2021, 2:51 PM
So we can create a KMM sdk, publish it to maven/cocoapods and then be able to use it though Android or iOS Native and not KMM projects?
k

Kris Wong

03/02/2021, 2:58 PM
correct, for the most part
p

ptsiogas

03/02/2021, 4:02 PM
@Kris Wong thanks, I will check it out. It would be great to do such stuff out of the box, it could give KMM a major boost in the mobile community.
k

Kris Wong

03/02/2021, 4:03 PM
it pretty much is "out of the box", but it's certainly not perfect
👍🏼 1
👍 1
3 Views