The Android NDK allows us to write fully native applications without a line of Java code. NativeActivity
provides a skeleton to implement an event loop that processes application events. Associated with the Posix time management API, the NDK provides the required base to build complex multimedia applications or games.
In summary, we created NativeActivity
that polls activity events to start or stop native code accordingly. We accessed the display window natively, like a bitmap, to display raw graphics. Finally, we retrieved time to make the application adapt to device speed using a monotonic clock.
The basic framework initiated here will form the base of the 2D/3D game that we will develop throughout this book. However, although the flat design is in fashion nowadays, we need something a bit fancier than red squares!
In the next chapter, we will discover how to render advanced graphics with OpenGL ES 2 for Android.