15. Using Android’s Optional Hardware APIs

The Android Software Development Kit (SDK) provides a variety of application programming interfaces (APIs) for accessing low-level hardware features on the handset. Device sensors available on Android devices include the magnetic and orientation sensors, WiFi sensor, and battery indicator. The magnetic sensor can be used as a compass, and the accelerometer sensor can detect motion. The WiFi sensor can read network status and determine nearby wireless access points. You can also monitor the state of the battery and power management state information. Other hardware, such as the camera and location-based services, we talked about in Chapter 12, “Using Android Multimedia APIs,” and Chapter 11 ...

Get Android Wireless Application Development 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.