1 of 22

O U R S P O N S O R S

April 23th, 2024

Uniting Native SDKs into Kotlin Multiplatform

An introduction to property based testing with Kotest

VIE

2 of 22

Sponsors

2

VIE

3 of 22

Housekeeping

http://kotlin.wien

-XenableGarbageCollection

3

VIE

4 of 22

News

  • Find us on LinkedIn

4

VIE

5 of 22

Community Interview

VIE

6 of 22

1 Volunteer

7 easy Questions

Your favourite topic

In German or English

6

VIE

7 of 22

Community Interview

Who are you in one sentence?

How long have you been working with Kotlin?

What are you working on (in Kotlin)?

How is Kotlin used in this project?

Tell us about a Kotlin win.

Tell us about a Kotlin fail.

Any problems/wins using Java Libraries?

Kotlin Frameworks / Features:

  • Arrow
  • AtomicFu
  • Coroutines
  • Exposed
  • Gradle DSL
  • HTML DSL
  • Kodein
  • KotlinX-IO
  • Kotlin Serialization
  • Ktor
  • Ktorm
  • MockK
  • TornadoFx

7

VIE

8 of 22

Upcoming Schedule 2024

May: Java Vienna Meetup - Venkat Edition! 6th May

May: KotlinConf 2024 Global Watchparty 23rd May� with Kotlin Vienna

June: Java Vienna Meetup: CDC w/ Debezium; 3rd June� Privacy leaks beyond the class-level

June: Kotlin Vienna Meetup: Arrow - upgrade � your funcy Kotlin! 11th June

August: Kotlin Vienna Stammtisch 20th August

8

VIE

9 of 22

Contact us

If you have any questions or want to get in touch with us, you are more than welcome to do so!

Our contact information:

meetup@kotlin.wien

9

VIE

10 of 22

Uniting Native SDKs into KMP

Giancarlo Buenaflor

CONFIDENTIAL

VIE

11 of 22

Create a KMP SDK

Native SDKs are available, so we can reuse them

VIE

12 of 22

Java/Android SDK

Cocoa SDK

VIE

13 of 22

VIE

14 of 22

expect/actual

VIE

15 of 22

Use typealias

We can use expect/actual to define typealiases

Normal bridge

Implement the common code with standard bridge

VIE

16 of 22

expect/actual typealias

Allows writing much less code

VIE

17 of 22

Cons of expect/actual typealias

  • Signatures need to match - contains edge cases
  • Can be brittle, lead to runtime errors if not tested properly
  • Might not be possible to write idiomatic Kotlin
  • Needs to have the API exposed

VIE

18 of 22

Bridge classes

VIE

19 of 22

No need to create a new class for everything

Sometimes we only care about mutating state in the Native SDKs

VIE

20 of 22

VIE

21 of 22

Pass data to native SDKs

  • We only care about mutating state
  • Saves time in synchronization of states between KMP and native layers

VIE

22 of 22

Thank you!

  • Sometimes you can pass data directly to the native SDKs
  • Using expect/actual typealiases can be useful in certain situations
  • Be prepared to write some boilerplate

VIE