Hi! One question. The Kotlin multiplatform is only...
# multiplatform
a
Hi! One question. The Kotlin multiplatform is only business logic? In other words, is it possible import dependencies, for example okhttp?
v
You can import dependencies, but probably not the ones you want. OkHttp is built for JVM, so you can’t use OkHttp if you want to build to Native(e.g. iOS). But you should have a look at Ktor (http://ktor.io), a network server/client library by Jetbrains. They just released a beta version with multiplatform support.
1
a
Thank you. This tutorial will be useful http://ktor.io/clients/http-client/multiplatform.html?
And more things... is it possible the with js?
c
yep the tutorial is useful. I've had a lot of problems with 0.9.5, while using 1.0.0 beta everything works
g
it’s impossible to use Jvm dependencies, correct, but interesting that people from Square actually plan to make okhttp multiplatform, they already did it with okio Check this talk if you interested

https://www.youtube.com/watch?v=Q8B4eDirgk0

Slide from this talk about porting another libraries to multiplatform
For now you can use ktor client as multiplatform http client
a
Do you have an example uploaded? @coletz
Or @gildor
c
nope, sorry. At the moment I don't have a completely working example, but you can check this one https://github.com/touchlab/DroidconKotlin/
woops sorry, ktor is not used here :S
s
I have an example with mpp client
But I can't compile the JS project, for iOS and Android works
k
I talked about libraries a bit in my talk. Listed what's currently available for mobile dev. Should follow up with a post on that, but working on a new library. Only so much time. The droidcon app is strictly native mobile. No JS. Sqldelight should "run" on JS, but JS doesn't (officially) support sql. http://www.youtube.com/watch?v=Dul17VSiejo&t=24m0s
a
Thanks @Sergio Casero, but it haven’t ktor client, right?
s
It has the ktor client common
a
sorry, it’s in feature/network_calls_common_client branch
s
Yep!