In this chapter, we covered multiple ways to interact with Android from native code. More precisely, we discovered how to attach an input queue to the Native App Glue
event loop. Then, we handled touch events and processed key events from keyboards and D-Pads or motion events from trackballs. Finally, we turned the accelerometer into a Joypad.
Because of Android fragmentation, expect specificities in an input device's behavior and be prepared to tweak your code. We have already been far in the capabilities of Android NDK in terms of application structure, graphics, sound, input, and sensors. However, reinventing the wheel is not a solution!
In the next chapter, we will unleash the real power of the NDK by porting existing C/C++ libraries to Android.