Glen
09/24/2020, 1:12 PMlouiscad
09/24/2020, 2:27 PMGlen
09/24/2020, 2:49 PMlouiscad
09/24/2020, 2:55 PMGlen
09/24/2020, 3:00 PMlouiscad
09/24/2020, 3:07 PMGlen
09/24/2020, 3:10 PMlouiscad
09/24/2020, 3:11 PMGlen
09/24/2020, 3:23 PMlouiscad
09/24/2020, 3:43 PMgildor
09/25/2020, 5:42 AMSo I will have to write wrappers for coroutines in the form if callbacks...Serious lot of work...Some C++ Future/Promice class can be exposed instead of callback, so it would be enough to write one single await() function for it, so it will be universal for all async calls to native code But in general it really depends what kind C code you try to integrate
Glen
09/25/2020, 8:47 AMlouiscad
09/25/2020, 8:57 AMgildor
09/25/2020, 9:11 AMGlen
09/25/2020, 9:16 AMgildor
09/25/2020, 9:39 AMThe first is, why can’t I use K/N to avoid JNI altogetherYou can, but then you have to write JNI to talk with K/N from Android It maybe a viable option if most of loigic on k/n side and you have simple interaction with it
How can I add coroutines on top of the JNI API?,JNI api is just Java (or Kotlin JVM) code, no issue to write coroutines adapter on top of it
Glen
09/25/2020, 9:51 AMgildor
09/25/2020, 10:01 AMGlen
09/25/2020, 10:04 AMgildor
09/25/2020, 10:10 AMGlen
09/25/2020, 10:14 AMexternal fun
methods and wrap them with coroutines.gildor
09/25/2020, 10:24 AMGlen
09/25/2020, 10:27 AMgildor
09/25/2020, 10:56 AMGlen
09/25/2020, 11:00 AMgildor
09/25/2020, 2:30 PMGlen
09/26/2020, 12:50 PM