https://kotlinlang.org logo
Title
p

Paul Woitaschek

03/20/2019, 4:09 PM
Does someone know which bigger companies use kotlin native for shared logic between iOS and android? I'm advocating for that within my company and would like to quote that we're not the only company doing this on the earth 😉
👍 2
m

Mohammadsss1

03/20/2019, 4:13 PM
Me too, I want to make sure that there are success stories of using kotlin native on production
r

ribesg

03/20/2019, 4:15 PM
I know that a multiplatform client for Algolia should be released in a few weeks (by Algolia)
And we’re currently rewriting our main mobile app as a multiplatform project (I’m working at Wizbii)
e

Ellen Shapiro

03/20/2019, 5:04 PM
I’m looking at a couple things coming soon, but I work at an agency so I’m not sure if that counts - I know people tend to give “an agency is doing it!” the side-eye because agencies often don’t have to deal with long term maintenance
m

Mohammadsss1

03/20/2019, 6:46 PM
@ribesg For both iOS and Android?
n

Narek Mailian

03/20/2019, 8:25 PM
We will soon! Sveriges Radio 🎶
r

ribesg

03/21/2019, 8:52 AM
@Mohammadsss1 yes
p

Paul Woitaschek

03/23/2019, 11:26 AM
n

Narek Mailian

03/24/2019, 1:06 PM
We did encounter those problems, but since our architecture isn't built on generics and doesn't use mutable objects passed along threads we felt that it was production-ready enough for us to use 🙂
So we have api-calls, json deserialization, entities, presentation logic and viewmodels in a shared library, and views in iOS/Android-code
m

Mohammadsss1

03/24/2019, 7:31 PM
Hey @Narek Mailian What did you use for both json deserialization and api-calls?
n

Narek Mailian

03/24/2019, 7:33 PM
Ktor-Client for networking and kotlinx.serialization for json-deserialization
👍 1
m

Mohammadsss1

03/24/2019, 7:35 PM
Sorry for my questions 😆, but did you implement any persistent layer in KN?
n

Narek Mailian

03/24/2019, 8:09 PM
How do you mean? The KN-layer fetches data and maps it over to a viewmodel representation. The native iOS-layer just maps the viewmodels to the view and subscribes to updates.
p

Paul Woitaschek

03/24/2019, 9:23 PM
Where do you cache data?
n

Narek Mailian

03/24/2019, 9:42 PM
Ah. Inside KN. The view-layer(iOS) is really thin, about 400 lines of code
Nothing that is persistant over sessions or between the individual screens, if that's what you mean. We only keep what is necessary to present the view at that time