March 2013
Intermediate to advanced
346 pages
8h 4m
English
Java code can pass parameters to native methods and receive the processing results returned. This recipe walks through how to pass parameters and receive returns in primitive types.
You should have built at least one Android application with native code before reading this recipe. If you haven't done so, please read the Writing a Hello NDK program recipe in Chapter 1, Hello NDK first.
The following steps create a sample Android application with native methods receiving input parameters from the Java code and returning the processing result back:
PassingPrimitive. Set the package name as cookbook.chapter2. Create an activity named PassingPrimitiveActivity ...