Home | History | Annotate | Download | only in BatchStepSensor
      1 
      2 
      3 
      4 page.tags="BatchStepSensor"
      5 sample.group=Sensors
      6 @jd:body
      7 
      8 <p>
      9   This sample demonstrates the use of the two step sensors (step detector and
     10   counter) and sensor batching. It shows how to register a {@link
     11   android.hardware.SensorEventListener} with and without batching and shows how
     12   these events are received.
     13 </p>
     14 
     15 <p>
     16   The Step Detector sensor fires an event when a step is detected, while the
     17   step counter returns the total number of steps since a listener was first
     18   registered for this sensor. Both sensors only count steps while a listener is
     19   registered.
     20 </p>
     21 
     22 <p>
     23   This sample only covers the basic case, where a listener is only registered
     24   while the app is running. Likewise, batched sensors can be used in the
     25   background (when the CPU is suspended), which requires manually flushing the
     26   sensor event queue before it overflows, which is not covered in this sample.
     27 </p>
     28