Introduction
Thanks to the Android native application APIs, it is possible to write an Android application with pure native code since Android API level 9 (Android 2.3, Gingerbread). That is, not a single line of Java code is needed. The Android native APIs are defined in several header files under the <NDK root>/platforms/android-<API level>/arch-arm/usr/include/android/
folder. Based on the features provided by the functions defined in these header files, they can be grouped as follows:
Activity lifecycle management:
native_activity.h
looper.h
Windows management:
rect.h
window.h
native_window.h
native_window_jni.h
Input (including key and motion events) and sensor events:
input.h
keycodes.h
sensor.h
Assets, configuration, and storage management:
configuration.h
asset_manager.h
asset_manager_jni.h
storage_manager.h
obb.h
In addition, Android NDK also provides a static library named native app glue to help create and manage native activities. The source code of this library can be found under the...