Hello everyone. I need to use a static C library, ...
# kotlin-native
g
Hello everyone. I need to use a static C library, written by a friend of mine. How do I include it in a Kotlin/Native project, using CInterop? And also, how do I use the library from there in an android client?
w.r.t. android you'll need to use JNI
g
Thanks, @Kris Wong, but can't I just use Kotlin/MPP to bypass the JNI solution?
k
no
that's not within the scope of multiplatform
g
My goal was to eliminate the need to use JNI.
Hey, @Kris Wong, I just found this resource : https://github.com/JetBrains/kotlin-native/tree/master/samples/androidNativeActivity, and the example demonstrates using Kotlin/Native in an android app.
Just showed you to check it out and see if I am dead wrong...
k
sure, if you want to write your android app using native code
do you really want to do that?
or as it appears in this case, if you want to write your app using only kotlin multiplatform, which will limit what other dependencies you can use
g
If possible, I want to do that.
a
There was a JW's talk at the past Droidcon NY about using KN and Kotlin JS in Android. I don't have any links handy but you can try Google it. May be it will help.
g
Thanks @Arkadii Ivanov. I wi;; check it out.