I'm working on a project that needs to hook into another project that is written in C, and it can be used by both Android and iOS. The project structure looks something like this.
├── Android
| ├── foo1.kt
| └── foo2.kt
├── iOS
| ├── foo3.swift
| └── foo4.swift
├── source
| ├── foo5.c
| └── foo6.c
The iOS team was able to make wrapper classes that will call the C files (since Swift isn't far removed from C), but I don't know how this would work on Android. The goal is to call foo() in my Kotlin class and somehow call foo() in the corresponding C library. By calling this function, it will trigger functionality elsewhere in the library. Is it even possible to bridge the gap between the C language and a JVM language?
example:
Kotlin class
class MyKotlinClass {
fun fooKotlin() {
fooC()
}
}
Calls C function
int fooC() {
// do stuff in the library that is somewhere else
}