Example code for handling sensor data on Android