Chapter 8. Using the Touchscreen and Sensors

In this chapter, we will cover the following topics:

  • Listening for click and long-press events
  • Recognizing tap and other common gestures
  • Pinch-to-zoom with multi-touch gestures
  • Swipe-to-Refresh
  • Listing available sensors – an introduction to the Android Sensor Framework
  • Reading sensor data – using the Android Sensor Framework events
  • Reading device orientation

Introduction

These days, mobile devices are packed with sensors, often including a gyroscope, magnetic, gravity, pressure, and/or temperature sensors, not to mention the touchscreen. This provides many new and exciting options to interact with your user. Through the sensors, you can determine three-dimensional device location and how the device itself is ...

Get Android Application Development Cookbook - Second Edition 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.