Chapter     3

Communicating with Native Code using JNI

In the previous chapter, you started exploring the Android NDK by going through its components, its structure, and its build system. Using this information you can now build and package any kind of native code with your Android applications. In this chapter, you will focus on the integration part by using the Java Native Interface (JNI) technology to enable the Java application and the native code to communicate with each other.

What is JNI?

The JNI is a powerful feature of the Java programming language. It allows certain methods of Java classes to be implemented natively while letting them be called and used as ordinary Java methods. These native methods can still use Java objects in ...

Get Pro Android C++ with the NDK now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.