Chapter 8. Handling Input Devices and Sensors
Android is all about interaction. Admittedly, that means feedback, through graphics, audio, vibrations, and so on. But there is no interaction without input! The success of today's smartphones takes its root in their multiple and modern input possibilities: touchscreens, keyboard, mouse, GPS, accelerometer, light detector, sound recorder, and so on. Handling and combining them properly is a key to enrich your application and to make it successful.
Although Android handles many input peripherals, the Android NDK has long been very limited in its support (not to say the very least), until the release of R5! We can now access it directly through a native API. Examples of available devices are:
- Keyboard, either physical (with a slide-out keyboard) or virtual (which appears on screen)
- Directional pad (up, down, left, right, and action buttons), often abbreviated as D-Pad.
- Trackball, optical ones included
- Touchscreen, which has made modern...