How We Moved SDKs to Kotlin Multiplatform and saved the world

How We Moved SDKs to Kotlin Multiplatform

and saved the world (kind of)

@devwithzachary / @ishley30
How We Moved SDKs to Kotlin Multiplatform and saved the world

Intros

Ashley Arthur

Software Dev Engineer

The brains behind the talk
@ishley30

@devwithzachary / @ishley30
How We Moved SDKs to Kotlin Multiplatform and saved the world

Intros

Zachary Powell

Sr Android Developer Advocate Manager, DevRel

The one that gets to talk to you.
@DevWithZachary

@devwithzachary / @ishley30
How We Moved SDKs to Kotlin Multiplatform and saved the world

Takeaways

@devwithzachary / @ishley30
How We Moved SDKs to Kotlin Multiplatform and saved the world

Takeaways

Not another Kotlin Multiplatform code talk.

@devwithzachary / @ishley30
How We Moved SDKs to Kotlin Multiplatform and saved the world

Takeaways

Real world example of a team building a library in Kotlin Multiplatform

@devwithzachary / @ishley30
How We Moved SDKs to Kotlin Multiplatform and saved the world

Takeaways

Learn from the pain

  • History of the SDK's
  • Past attempts at codeshare
@devwithzachary / @ishley30
How We Moved SDKs to Kotlin Multiplatform and saved the world

Takeaways

See the success!

  • Main changes from old codeshare
  • The SDKs now
  • Suprising improvements
@devwithzachary / @ishley30
How We Moved SDKs to Kotlin Multiplatform and saved the world

What are the Vonage Client SDKs?

@devwithzachary / @ishley30
How We Moved SDKs to Kotlin Multiplatform and saved the world

What are the Vonage Client SDKs?

Android, iOS and JS SDKs

@devwithzachary / @ishley30
How We Moved SDKs to Kotlin Multiplatform and saved the world

What are the Vonage Client SDKs?

Wrappers for the Vonage REST/WebRTC APIs

@devwithzachary / @ishley30
How We Moved SDKs to Kotlin Multiplatform and saved the world

What are the Vonage Client SDKs?

Make it easier to use the Vonage APIs in a native friendly way

Developers are our world.

@devwithzachary / @ishley30
How We Moved SDKs to Kotlin Multiplatform and saved the world

History Lesson

A long time ago in a tech company far, far away....

@devwithzachary / @ishley30
How We Moved SDKs to Kotlin Multiplatform and saved the world
  • Three native SDK's, Android, iOS, JS all separate
  • Tough to test across all platforms
  • New features written by three separate teams
  • 3x the work to implement something new
@devwithzachary / @ishley30
How We Moved SDKs to Kotlin Multiplatform and saved the world

Nexmo was bought by Vonage.

@devwithzachary / @ishley30
How We Moved SDKs to Kotlin Multiplatform and saved the world

Rewrite!

@devwithzachary / @ishley30
How We Moved SDKs to Kotlin Multiplatform and saved the world

Kotlin Multiplatform try 1

  • JS team took a look at Kotlin Multiplatform at a VERY early stage
  • They wanted to rebuild EVERYTHING in Kotlin Multiplatform
  • This failed.
  • But we still want shared code!
@devwithzachary / @ishley30
How We Moved SDKs to Kotlin Multiplatform and saved the world

Enter C++

  • Allowed for some codeshare
  • Base level with platform specific code written on top.
@devwithzachary / @ishley30
How We Moved SDKs to Kotlin Multiplatform and saved the world

Happy Codeshare! Right?!

@devwithzachary / @ishley30
How We Moved SDKs to Kotlin Multiplatform and saved the world

No.

@devwithzachary / @ishley30
How We Moved SDKs to Kotlin Multiplatform and saved the world

Or Not.

  • Still had three separate code bases on top of the C++ layer
  • C++ code wasn't accessible to all on the team.
  • Very slow builds limiting release cadence
@devwithzachary / @ishley30
How We Moved SDKs to Kotlin Multiplatform and saved the world

Rewrite!

@devwithzachary / @ishley30
How We Moved SDKs to Kotlin Multiplatform and saved the world

But with what?

  • Shared code, just better
  • Share business logic, not low-level platform stuff
@devwithzachary / @ishley30
How We Moved SDKs to Kotlin Multiplatform and saved the world

What options?

@devwithzachary / @ishley30
How We Moved SDKs to Kotlin Multiplatform and saved the world

No. Please. No.

@devwithzachary / @ishley30
How We Moved SDKs to Kotlin Multiplatform and saved the world

Rust

  • Very powerful
  • Good shared codebase option
  • Doesn't solve binding issues.
  • Tooling for native was relatively unknown.
@devwithzachary / @ishley30
How We Moved SDKs to Kotlin Multiplatform and saved the world

Kotlin Multiplatform

  • Also a very good option for shared codebase
  • Bindings solved!
  • Let's Prototype
@devwithzachary / @ishley30
How We Moved SDKs to Kotlin Multiplatform and saved the world

Prototype

  • December 2021, Perfect time to hide and build the prototype.
  • Very careful about what to put into the shared code
  • Kotlin Multiplatform for business logic. Platform specific code stays out!
@devwithzachary / @ishley30
How We Moved SDKs to Kotlin Multiplatform and saved the world

Platform Specific

  • Networking - HTTP client, WebSocket, WebRTC client.
  • Platform specific exposed behind interfaces for Kotlin Multiplatform to access.
@devwithzachary / @ishley30
How We Moved SDKs to Kotlin Multiplatform and saved the world

Prototype delivered!

And it worked!

@devwithzachary / @ishley30
How We Moved SDKs to Kotlin Multiplatform and saved the world

Then drama!

@devwithzachary / @ishley30
How We Moved SDKs to Kotlin Multiplatform and saved the world

Ashley dared to have a baby (congratulations)

@devwithzachary / @ishley30
How We Moved SDKs to Kotlin Multiplatform and saved the world

Team members left

@devwithzachary / @ishley30
How We Moved SDKs to Kotlin Multiplatform and saved the world

Team had to focus on bug fixing in the current SDK

@devwithzachary / @ishley30
How We Moved SDKs to Kotlin Multiplatform and saved the world

But wait!

@devwithzachary / @ishley30
How We Moved SDKs to Kotlin Multiplatform and saved the world

The team is reminded of the pain points

@devwithzachary / @ishley30
How We Moved SDKs to Kotlin Multiplatform and saved the world

Ashley returns!

@devwithzachary / @ishley30
How We Moved SDKs to Kotlin Multiplatform and saved the world

“Sod it let's do it” - Ashley

@devwithzachary / @ishley30
How We Moved SDKs to Kotlin Multiplatform and saved the world

From Prototype to SDK

What needed to happen?

@devwithzachary / @ishley30
How We Moved SDKs to Kotlin Multiplatform and saved the world

Focus had just been on iOS and Android, JS was needed as well!

@devwithzachary / @ishley30
How We Moved SDKs to Kotlin Multiplatform and saved the world

I asked the team

What were the main changes?

@devwithzachary / @ishley30
How We Moved SDKs to Kotlin Multiplatform and saved the world

Team had to learn Kotlin

mix of Android, iOS and JS devs

@devwithzachary / @ishley30
How We Moved SDKs to Kotlin Multiplatform and saved the world

All in on Gradle

This made iOS devs sad.

@devwithzachary / @ishley30
How We Moved SDKs to Kotlin Multiplatform and saved the world

Shift in tooling, moving to a new IDE

A lot of the team had been using their own preferred IDE/text editors for the shared C++ code.

@devwithzachary / @ishley30
How We Moved SDKs to Kotlin Multiplatform and saved the world

Today!

Vonage Client SDK for Voice released!

iOS, Android and Javascript!

@devwithzachary / @ishley30
How We Moved SDKs to Kotlin Multiplatform and saved the world

Coming Soon!

Vonage Client SDK for Chat!

iOS, Android and Javascript!

@devwithzachary / @ishley30
How We Moved SDKs to Kotlin Multiplatform and saved the world

Lessons Learnt / Reflection

What changed?

@devwithzachary / @ishley30
How We Moved SDKs to Kotlin Multiplatform and saved the world

Keep up to date with Kotlin updates

Language still getting large updates

@devwithzachary / @ishley30
How We Moved SDKs to Kotlin Multiplatform and saved the world

Original pain point of consistency has been removed!

Write once for everywhere!

@devwithzachary / @ishley30
How We Moved SDKs to Kotlin Multiplatform and saved the world

Platform code is just exposing the functionality

More time to work on improving the API contract and making the SDK a joy to use!

@devwithzachary / @ishley30
How We Moved SDKs to Kotlin Multiplatform and saved the world

Everyone knows Kotlin, anyone can build a feature

unlike before with C++/SDK

@devwithzachary / @ishley30
How We Moved SDKs to Kotlin Multiplatform and saved the world

Move to a Mono repo

Whole team synced across all platforms

@devwithzachary / @ishley30
How We Moved SDKs to Kotlin Multiplatform and saved the world

We have tests!

Tests are the key to saving developers (which are our world!)

@devwithzachary / @ishley30
How We Moved SDKs to Kotlin Multiplatform and saved the world

Go check out the SDKs

Coupon Code, €10 free credit: 23CDLIS10

developer.vonage.com

github.com/Vonage-Community/tutorials-client_sdk-ios-android-js

@devwithzachary / @ishley30
How We Moved SDKs to Kotlin Multiplatform and saved the world

Thank you!

links.zpweb.site

github.com/devwithzachary/presentations

@devwithzachary / @ishley30