worked with OpenCV on C++, now it’s time to do it on android. How to connect the old C++ project to jni?
Answer 1, Authority 100%
- Download NDK – Native Development Kit
- set ndk – specifically decide on toolchain
- Plant your source in Tree
SRC / JNI
- Write make Make files for building sources:
Application.mk
andAndroid.mk
- Register in Gradle rules of construction (I do not use it – therefore I will not tell you, I usually collect from the command line)
- Write JNI Interfaces – Bundles between C++ and Java code
- Collect, in the end you will receive 3 or 4 lips for different platforms:
ABI
x86
,arm
, etc.
Perhaps the instruction is slightly outdated, I have not codified C++ under Android