Chapter 5. Android Native Application API

In this chapter we will cover the following recipes:

  • Creating a native activity with the native_activity.h interface
  • Creating a native activity with the Android native app glue
  • Managing native windows at Android NDK
  • Detecting and handling input events at Android NDK
  • Accessing sensors at Android NDK
  • Managing assets at Android NDK

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 ...

Get Android Native Development Kit Cookbook 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.