O'Reilly logo

Android NDK Beginner's Guide by Sylvain Ratabouil

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 3. Interfacing Java and C/C++ with JNI

Android is inseparable from Java. Although its kernel and its critical libraries are native, the Android application framework is almost entirely written in Java or wrapped inside a thin layer of Java. Obviously, a few libraries are directly accessible from native code, such as Open GL (as we will see in Chapter 6, Rendering Graphics with OpenGL ES). However, most APIs are available only from Java. Do not expect to build your Android GUI directly in C/C++. Technically speaking, it is not yet possible to completely get rid of Java in an Android application. At best, we can hide it under the cover!

Thus, native C/C++ code on Android would be nonsense if it is was not possible to tie Java and C/C++ together. ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required