Accelerometer
Android Device | Android Emulator | iOS Device | iOS Simulator |
✅ | ✅ | ✅ | ❌ |
An acceleration sensor measures the acceleration applied to the device, including the force of gravity
Installing
API
startAccelerometerUpdates(...)
Starts listening for accelerometer updates.
stopAccelerometerUpdates()
Stops listening for accelerometer updates.
isListening()
Gets info about the current state of listening for accelerometer updates.
Returns: boolean
Interfaces
AccelerometerData
Prop | Type |
x | number |
y | number |
z | number |
AccelerometerOptions
Prop | Type |
sensorDelay | number |
Enums
SensorDelay
Members | Value | Description |
Normal | "normal" | rate (default) suitable for screen orientation changes |
Game | "game" | rate suitable for games |
UI | "ui" | rate suitable for the user interface |
Fastest | "fastest" | get sensor data as fast as possible |