3 ms·
Isn't JNI on Android also "NDK"? NDK provides a compiler toolchain and a build system — if you're building native libraries to JNI into, that's also built by ND
by floatboth 10y ago
Isn't JNI on Android also "NDK"? NDK provides a compiler toolchain and a build system — if you're building native libraries to JNI into, that's also built by NDK.
- flohofwoe 10y agoInternally: yes. But if all you need is the C-APIs provided by the NDK you don't need to deal with JNI (or Java). Unfortunately the NDK doesn't provide much.
- pjmlp 10y agoYes, but I imagine you never had the "pleasure" to use it.
- floatboth 10y agoDidn't have any problems either. I mean, writing JNI code by hand is hell, sure. Just… don't do it. javacpp automates all that crap. https://github.com/myfreeweb/freepass/blob/fad2a1fd592cbe6a9d8388a5fb7e8b4703ebeccd/android/app/src/main/kotlin/technology/unrelenting/freepass/Vault.kt#L9-L10 https://github.com/myfreeweb/freepass/blob/fad2a1fd592cbe6a9...
- pjmlp 10y agoThe point is calling Framework APIs from C++. Of course there are workarounds like Swig, Djini, JNICpp, but those are just that, workarounds for the lack of support from the Android team. iOS and UWP devs support C++ use via Objective-C++ and C++/CX (to be eventually replaced by C++/WinRT), even if C++ isn't the main platform language, instead of leaving the community alone to sort out the FFI issues. Since Android is anyway a fork of Java, they could either provide C++ Frameworks that wrap Android APIs or provide something like gcj CNI.