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.
03/01/2021, 4:17 PM
yes, it makes sense to use KMM to create libraries
even in the shared source repos the KMM component is a separate module (a library)
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?
03/02/2021, 2:34 PM
no, this is why we have dependency managers.
Maven & Cocoapods to be specific
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?