https://kotlinlang.org logo
#android
Title
# android
r

robjperez

09/11/2019, 9:56 AM
I have a cross platform library for ios/android written in C/C++ and it would be nice to be able to call it from kotlin without all the JNI fuss
m

Marko Mitic

09/11/2019, 10:00 AM
Cinterop is available in Kotlin Native, AFAIK it's not available in Android/JVM
r

robjperez

09/11/2019, 10:01 AM
Thanks for the reply. That is what I have understood by reading the documentation too
but, if you create a kotlin (native) library that calls c code via cinterop
can that kotlin library be called from Android code?
or once you have a kotlin native component, you cannot be called from Art/JVM world?
Initially I saw Cinterop like c# Platform Invoke, where you can call from .NET VM to native libraries. But I think that's not the case
m

Marko Mitic

09/11/2019, 10:04 AM
I think you'd still need JNI to access kotlin native functions
you can ask at #kotlin-native
👍 1
r

robjperez

09/11/2019, 10:05 AM
thanks 🙂
d

Dominaezzz

09/11/2019, 10:10 AM
Yes, except the PInvoke stuff is generate for you.
d

dewildte

09/11/2019, 3:36 PM
Can the NDK help here?
4 Views