Porting a library as a static library module with the Android NDK build system
The previous recipe discussed how to port a library as a
shared library module with the libbmp
library as an example. In this recipe, we will demonstrate how to port the libbmp
library as a static library.
Getting ready
Readers are recommended to read the Building an Android NDK application at the command line recipe in Chapter 3, Build and Debug NDK Applications, before going through this one.
How to do it...
The following steps describe how to create our sample Android project that demonstrates porting the libbmp
library as a static library:
Create an Android application named
PortingStatic
with native support. Set the package name ascookbook.chapter8.portingstatic
. Please refer to the Loading native libraries and registering native methods recipe of Chapter 2, Java Native Interface, if you want more detailed instructions.Add a Java file
MainActivity.java
under thecookbook.chapter8.portingstatic
package. This...