I am sure they are just returning the most recently received values.

Note that the sensors can very well be different hardware parts, that
generate updates on different schedules.  For example the accelerometer and
compass are very different types of hardware, and it would be a mistake to
think that they are intrinsically tied together in their data reporting.

On Sun, Oct 4, 2009 at 8:11 AM, bmcc <[email protected]> wrote:

>
> Thanks for the swift reply Mark.
>
> Hmmm that's a shame, i suppose I could listen for a sensorChanged
> event on the accelerometer, then for each other sensor in turn - and
> log the time delay between each event. Unsatisfactory as I'd really
> like to get the data every nth of a second to do some signal
> processing/filtering but that would rely on having a known
> frequency... ho hum :(
>
> BTW I was playing with Android Scripting Environment and there is a
> python example called sensors.py:
>
>
> import android
> droid = android.Android()
> droid.startSensing()
> .
> .
> sensors = droid.readSensors()
> print sensors
>
> I wonder what's going on "under the hood" there...?
>
> Thanks again,
> B
>
> On Oct 4, 3:52 pm, "Mark Murphy" <[email protected]> wrote:
> > > Up until now I have been using SensorEventListener.onSensorChanged
> > > (SensorEvent evt) to obtain data values from the on board sensors (G1)
> > > whenever a sensor event occurs (snippet below). However, what I really
> > > want to be able to do is read the values of all the sensors (i.e.
> > > Sensor.TYPE_ORIENTATION, Sensor.TYPE_ACCELEROMETER and
> > > Sensor.TYPE_MAGNETIC_FIELD) together at the same instant in time, or
> > > near enough as the system will allow.
> >
> > > I'm probably being thick but does anyone know whether there a way of
> > > reading the sensor values directly without having to use/wait for
> > > onSensorChanged() ?
> >
> > Not that I am aware of.
> >
> > The point of registering for sensor changes is, among other things, to
> > turn on that sensor. Not all sensors may be running at all times, since
> > their use drains the battery.
> >
> > --
> > Mark Murphy (a Commons Guy)http://commonsware.com
> > Android App Developer Books:http://commonsware.com/books.html
> >
>


-- 
Dianne Hackborn
Android framework engineer
[email protected]

Note: please don't send private questions to me, as I don't have time to
provide private support, and so won't reply to such e-mails.  All such
questions should be posted on public forums, where I and others can see and
answer them.

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to