Is there a way to get the values from an Android sensor say every 5 minutes?
For example, is there a way I can poll the AMBIENT_TEMPERATURE sensor every 5 minutes regardless of there being a change in temperature or not?
Right now, I can only access the values from onSensorChanged(SensorEvent arg0) when it gets called so if the temperature didn’t change from start up, I never can access the temperature value?
Thanks! =]
As far as I recall the senors return a value every
onSensorChanged-event. You can set up a thread, that reads in the values every 5 minutes.Edit:
OrientationHandler.values can be accessed from outside the class (if you write yourself a public Getter-method).