SENSOR_DELAY_GAME: how much is it?

Egor picture Egor · Jul 27, 2012 · Viewed 19.2k times · Source

I'm working on a game and I need to synchronize two player object controlling mechanisms: one is an on-screen touch controller and second is the G-Sensor. On-screen controller must be initialized with a value in seconds, so I need to know how much seconds does SENSOR_DELAY_GAME mean. Thanks in advance.

Answer

Makibo picture Makibo · Nov 20, 2012

Taken from http://developer.android.com/guide/topics/sensors/sensors_overview.html

The default data delay is suitable for monitoring typical screen orientation changes and uses a delay of 200,000 microseconds. You can specify other data delays, such as SENSOR_DELAY_GAME (20,000 microsecond delay), SENSOR_DELAY_UI (60,000 microsecond delay), or SENSOR_DELAY_FASTEST (0 microsecond delay). As of Android 3.0 (API Level 11) you can also specify the delay as an absolute value (in microseconds).

The delay that you specify is only a suggested delay. The Android system and other applications can alter this delay. As a best practice, you should specify the largest delay that you can because the system typically uses a smaller delay than the one you specify (that is, you should choose the slowest sampling rate that still meets the needs of your application). Using a larger delay imposes a lower load on the processor and therefore uses less power.