Including existing libraries
One of the main reasons why NDK is extensively used is to include other already existing libraries that provide some set of functionalities in C/C++. Maybe the most obvious example is OpenCV, which was originally written in C/C++. Rewriting it in Java will not only take time, but on top of that it will not be as efficient as its native counterpart.
Alternatively, you might want to create your own libraries and distribute them to third-party developers. It could even be possible to create a prebuilt version of the libraries that can be directly included in our project, so we speed up the build time rather than compiling the library with each build.
There are a set of steps we must follow in order to achieve this. First, each prebuilt library being used must be declared as a single independent module. This is how we achieve it.
The module must have a name. It does not strictly need to be the same as the prebuilt library, but it needs to contain a name:
Go to the
Android...