Chapter 13

Going Native with the NDK

After all the 3D extravagance in the past three chapters, it’s time to look into one more aspect of programming games for Android. While Java and the Dalvik VM are sufficient for a lot of game genres in terms of execution speed, there are times when you need a bit more power. This is especially true for physics simulations, complex 3D animation, collision detection, and so on. This type of code is best written in more “to-the-metal” languages like C/C++ or even assembly language. The Android native development kit (NDK) lets us do exactly that.

Implementing 3D animation or a physics engine in C/C++ is way outside the scope of this book. However, in Chapter 8 we identified a bottleneck that can be fixed with ...

Get Beginning Android Games, Second Edition 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.