Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

setting sample delay properly #6

Open
SagarPandit01 opened this issue Mar 24, 2017 · 0 comments
Open

setting sample delay properly #6

SagarPandit01 opened this issue Mar 24, 2017 · 0 comments

Comments

@SagarPandit01
Copy link
Contributor

From @graychan on September 8, 2014 18:32

When tapping on a sensor, one can set the sampling rate on release SimpleUiWithSoundSensors. However, it sometimes crashes the app. In addition, the sampling rate is difficult to enter and it may not be applied correctly to the sensors. The necessary improvements are

  • UI improvement
    • having two fields for sampling rate and sampling interval, respectively;
    • add a slider using which a user can slide it between a range without manually enter a number in either the sampling rate or interval field. The mininumm allowable value should be the returned value of getMinDelay()
    • add a group of radio buttons that allow a user to choose SENSOR_DELAY_FASTEST, SENSOR_DELAY_NORMAL, SENSOR_DELAY_GAME, and SENSOR_DELAY_UI, and manual setting. If the manual setting is chosen, then the user can choose samping rate or interval as describe before.
  • right now, if you set a sampling rate, it applies to all sensors. A user should be able to set different sampling rate for different sensors.
  • this only needs to and can only be applied to sensors whose sampling rate or interval could be programmably change to an arbitrary value. See the note below.

Note that Google documentation indicates that the sampling rate or intervals are enforced using the best effort approach, here is the quote from the documentation,

The rate sensor events are delivered at. This is only a hint to the system. Events may be received faster or slower than the specified rate. Usually events are received faster. The value must be one of SENSOR_DELAY_NORMAL, SENSOR_DELAY_UI, SENSOR_DELAY_GAME, or SENSOR_DELAY_FASTEST or, the desired delay between events in microseconds. Specifying the delay in microseconds only works from Android 2.3 (API level 9) onwards. For earlier releases, you must use one of the SENSOR_DELAY_* constants.

Copied from original issue: sysnetlab/SensorDataCollector#147

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant