Documentation
¶
Overview ¶
Sensor event loop pattern combining sensor and looper packages.
Demonstrates sensor discovery and type enumeration using the idiomatic sensor package, and documents the complete ALooper-based event queue pattern in comments. The event queue creation requires low-level access (ASensorManager_createEventQueue), so the actual event loop is shown as a documented pattern rather than executable code.
The executable portion of this example:
- Gets the sensor manager singleton.
- Queries the default accelerometer and prints its properties.
- Enumerates common sensor types, checking availability on the device.
This program must run on an Android device.
Click to show internal directories.
Click to hide internal directories.