Skip to content

An android app that visualizes device orientation using accelerometer and gyroscope data.

License

Notifications You must be signed in to change notification settings

msoftware/AndroidSensing

 
 

Repository files navigation

android-rotation-sensor-sample

This is a sample application that uses the Android rotation sensor and displays the device rotation (pitch/roll) with a custom view (an attitude indicator, aka "artificial horizon").

It shows proper usage of the following Android features:

  • Monitoring the rotation vector sensor (but only while the activity is visible).
  • Converting the raw rotation matrix to pitch and roll, measured in degrees.
  • Adjusting the rotation values based on the device orientation (e.g. portrait vs. landscape).
  • Drawing a custom view, including using Porter-Duff transfer mode to create an anti-aliased circle cut-out.

Screenshot

Check out the arch-components branch to see how to use the new Android Architecture Components (still in alpha) to start/stop the sensor listener.

About

An android app that visualizes device orientation using accelerometer and gyroscope data.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Java 100.0%