Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the difference between SENSOR_DELAY_NORMAL, SENSOR_DELAY_GAME, SENSOR_DELAY_UI and SENSOR_DELAY_FASTEST in Android

Can anybody tell me what is the difference between SENSOR_DELAY_NORMAL, SENSOR_DELAY_GAME, SENSOR_DELAY_UI and SENSOR_DELAY_FASTEST in Android sensors.

Where should a developer use all these things? What will user feel by using all these?

like image 818
Prasad Avatar asked Apr 06 '12 13:04

Prasad


People also ask

What is the purpose of SensorManager?

SensorManager lets you access the device's sensors . Always make sure to disable sensors you don't need, especially when your activity is paused. Failing to do so can drain the battery in just a few hours.

What are body sensors on Android?

Body Sensors: Allows access to your health data from heart-rate monitors, fitness trackers, and other external sensors. The good: Fitness apps need this permission to provide health tips, monitor your heart rate while you exercise, and so on.


2 Answers

Here are some approximations based on tested results:

Accelerometer, SENSOR_DELAY_FASTEST: 18-20 ms
Accelerometer, SENSOR_DELAY_GAME: 37-39 ms
Accelerometer, SENSOR_DELAY_UI: 85-87 ms
Accelerometer, SENSOR_DELAY_NORMAL: 215-230 ms
Orientation Sensor, SENSOR_DELAY_FASTEST: 16-17 ms
Orientation Sensor, SENSOR_DELAY_GAME: 37-39 ms
Orientation Sensor, SENSOR_DELAY_UI: 77 ms
Orientation Sensor, SENSOR_DELAY_NORMAL: 224-225 ms

You can also define your own rate, for example 100ms.

int READINGRATE = 100000; // time in us
mSensorManager.registerListener(this, mLinearAccelerometer, READINGRATE);

However the rate is just an approximation, if you need an accurate rate it is better to use a timer.

like image 119
nabrugir Avatar answered Nov 15 '22 18:11

nabrugir


read this
http://developer.android.com/guide/topics/sensors/sensors_overview.html

SENSOR_DELAY_FASTEST 0 microsecond
SENSOR_DELAY_GAME 20,000 microsecond
SENSOR_DELAY_UI 60,000 microsecond
SENSOR_DELAY_NORMAL 200,000 microseconds(200 milliseconds)

like image 36
jeonggu Avatar answered Nov 15 '22 19:11

jeonggu