Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.
This section presents the many new technologies that we use in the Doodlz app in the order they’re encountered throughout the chapter.
Though we don’t use any Android-3.0 features in this app, we specify in the app’s manifest that we target the Android 3.0 SDK (Section 9.4.2). Doing so allows the app’s GUI components to use Android 3.0’s look-and-feel—the so-called holographic theme—on Android tablet devices. In addition, the app’s menu is displayed at the right side of the Android 3.0 action bar, which appears at the top of the screen on tablet devices.
SensorManager to Listen for Accelerometer EventsThis app allows the user to shake the device to erase the current drawing. Most devices have an accelerometer that allows apps to detect movement. Other sensors currently supported by Android include gravity, gyroscope, light, linear acceleration, magnetic field, pressure, proximity, rotation vector and temperature. The list of Sensor constants representing the sensor types can be found at: