Amit Pal
Amit Pal

Reputation: 11062

Kotlin multiplatform for developing Mobile SDK?

I am building a mobile and web SDK to consume our platform API (s). We are a very small team and do not want to depend on multiple mobile and web platforms.

I was reading about kotlin multiplatform and using the official guidance, we can achieve interoperability (IMO) in terms of writing a single code base and a plug-in as a library to multiple platforms such as JS, Native Android, IOS, and non-native platforms such as react-native and Flutter.

What would be the good approach and links to develop such a library incase it's possible? Any thoughts on it?

Thanks

Upvotes: 2

Views: 526

Answers (1)

Kevin Galligan
Kevin Galligan

Reputation: 17352

We do this with multiple clients. Doing this is becoming easier with better tooling, and on native, the new non-strict memory model. Of course, the tech is relatively new, so the more difficult part will be packaging and distribution, but that's the kind of config work you'd likely need to do anyway regardless of implementation.

I don't have a great single link for you. Just several from people on the Touchlab team, with one notable exception.

https://twitter.com/shaktiman_droid/status/1546592640879165440

https://twitter.com/KevinSchildhorn/status/1519024016203333633

https://dev.to/touchlab/add-kotlinjs-support-to-your-kmm-library-48d9

https://dev.to/touchlab/dividing-kotlin-multiplatform-work-in-teams-2cad

mParticle actually generates a shared SDK with KMP, from an analytics data file. https://docs.mparticle.com/developers/smartype/. I haven't played with it in over a year, but they do seem to be updating it: https://github.com/mParticle/smartype.

Also, we had a few Kotlin/JS talks at Droidcon NYC this year. Those videos aren't public yet, but check them out when they are.

We (Touchlab) are about to release something that enables this much more easily for native mobile targets. JS, while we use it, is much less common of a request and hasn't yet been prioritized.

Finally, join the official Kotlin slack. There's plenty of support, and the Kotlin team often replies directly to help.

Good luck!

Upvotes: 3

Related Questions