Porting a command-line executable to Android with an NDK build system
This recipe discusses how to port a command-line executable to Android with an NDK build system. We will use the open source Fugenschnitzer program (fusch
) as
an example.
Getting ready
You should read the Porting a library as a static library with an Android NDK build system recipe in Chapter 8, Porting and Using Existing Libraries with Android NDK, before going through this one.
How to do it...
The following steps describe how to port the fusch
program to Android with an NDK build system:
Create an Android application named PortingExecutable with native support. Set the package name as
cookbook.chapter9.portingexecutable
. Refer to the Loading native libraries and registering native methods recipe in Chapter 2, Java Native Interface, if you want more detailed instructions.Remove the existing content under the
jni
folder of the project.Download the source code of the
fusch
library and command-line application from http://fugenschnitzer...