Back to Trending
RepositoryJavaDEGermany
majidgolshadi

majidgolshadi/Android-Orientation-Sensor

Android Sensor Orientation Library helps you to get more accurate vector values of orientation, using all available device sensors.

115stars
21forks
1issues
1views

Android Arsenal The MIT License

Android-Orientation-Sensor

Android Sensor Orientation Library helps you to get more accurate vector values of orientation, using all available device sensors.

Overview

In one of my project (parallax library for android application) ,i need to use orientaion sensor values but they are too noisy so I decided to create a native library for android plateform to return these values with less noise. My purpose for sharing this code in public is to solve anybody who has this problem like me. To do this I use Accelerometer, Gyroscope, Magnetic and Orientation sensors values.

Usage

to use this library you can add codes to your project and easily use it.

Create it's object

Orientation orientationSensor = new Orientation(this.getApplicationContext(), this);

this stands for a class who implements OrientationSensorInterface class

Turn sensor ON

//------Turn Orientation sensor ON-------
// set tolerance for any directions
orientationSensor.init(1.0, 1.0, 1.0);

// set output speed and turn initialized sensor on
// 0 Normal
// 1 UI
// 2 GAME
// 3 FASTEST
orientationSensor.on(0);

first it must be initialized. You can set delta value for any direction you want(e.g 1.0).
you can control your sensor pooling speed when you turn your sensor on

Turn sensor OFF

orientationSensor.off();

if my introduction was not completely you can see TestActivity class that i put it in this project as a library usage sample.
I hope to this library helpful for any body that use it.
I'm realy happy to people who can help me to improve this code.

Similar Projects

Discover other similar projects and AI models.

RepositoryC
libdriver/mpu6050

MPU6050 full-featured driver library for general-purpose MCU and Linux.

432
Oct 24, 2026
RepositorySwift
yemcube/lidtap

Tap your MacBook lid: turn the display's edges into buttons using the built-in motion sensor. No extra hardware. macOS menu bar app.

245
Nov 5, 2026
Repository
hadess/iio-sensor-proxy

IIO accelerometer sensor to input device proxy

198
Jan 9, 2020
RepositoryObjective-C++
Varvrar/ios_logger

Application for camera and sensor data logging (iOS)

171
Sep 7, 2020
RepositoryC++
stereolabs/zed-open-capture

Low level Linux camera driver for the ZED USB3 stereo cameras. API docs available here:

148
Nov 18, 2026
RepositorySwift
degtiarev/MotionCollector

iOS app for collecting data from internal motion sensors (gyroscope, magnetometer, accelerometer) of iPhone and Apple Watch.

110
Apr 20, 2023
RepositorySwift
maximbilan/iOS-CoreMotion-Example

Core Motion in iOS using Swift

105
Sep 22, 2018
RepositoryC++
wollewald/MPU9250_WE

An Arduino library for the 9-axis accelerometer, gyroscope and magnetometer MPU9250 and MPU6500. It contains many example sketches make it easy to use.

104
Oct 25, 2025
RepositoryJavaScript
psiphi75/ahrs

AHRS (Attitude Heading Reference Systems) calculation for JavaScript

96
Feb 28, 2026