The Sensitive Side of Android

The Sensitive Side of Android
Ankur Kotwal, Tim Bray, Tony Chan
Android Developer Advocates

Sensors – the hardware in Android devices
- Demo: Blackjack
- tried to simulate natural interaction
- used Touch events GestureDetector, VelocityTracker and Gesture builder sample
- data gathering phase and gesture detection phase

Best Practices for using Sensors
- Tailor your rate by how often the data is returned, don’t use the fastest possible
- Unregister aggressively so the app isn’t processing data that isn’t being used which drains the battery

Proximity Sensor
- found on phones to turn screens off
- provides continuous or binary values

Light Sensor Gesture
- can be used with the proximity sensor

- motion related changes to apps

- controls-free/clean-screen apps (tap, shake, wave, chop)
- Sensplore: to collect data
- accelerometer, gravity, gyro, linear acceleration, magnetic field, orientation(depricated), rotation vector
- watch out for sensor rotation – blog post
- power consumption
- sampling rate (only as fast as you need, stop when not needed)
- static & random variation
- accelerometer data (unless in orbit)

Tilting a mostly-flat device
- games can use sensors directly
- sensors are not really very good compared to a Wii or Kinect

- use the microphone for things beyond voice
Demo: heartbeat monitor
- MediaRecorder
- AudioRecorder if you need more processing with the source
- picking the right sampling rate 44.1kHz in all devices, understand the signal before selecting the frequency
- buffering by responsiveness, memory/CPU cycles, tolerance to failures
- ASP audio signal processing filter noises, spectral analysis, easy in frequency rather than time
- Discrete Fourier Transform (DFT)

Making sense out of your Sensor Data
- Thresholds
- Time
- Statistics
1. Mean, median, mode, range, etc.
2. Moving/weighted average

- android includes a visualizer but only applies a currently audio track
- custom visualizer, you have to down sample for display and use a circular buffer for a scroll effect

About these ads

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s