Managing native windows at Android NDK
The previous recipes in this chapter provided simple examples with the logcat output only. This recipe will discuss how to manage the native window at Android NDK.
Getting ready
Readers are recommended to read the following recipes before going through this one:
Creating a native activity with the native_activity.h interface
Creating a native activity with the Android native app glue
Also recall that native window management has been introduced briefly in the Displaying graphics with EGL recipe in Chapter 4, Android NDK OpenGL ES API.
How to do it…
The following steps create the sample application:
Create an Android application named
NativeWindowManagement
. Set the package name ascookbook.chapter5.nativewindowmanagement
. Please refer to the Loading native libraries and registering native methods recipe of Chapter 2, Java Native Interface, if you want more detailed instructions.Right-click on the
NativeWindowManagement
project, select Android Tools | Add Native...