Android - counting sensor updates -
i trying make app including proximity gestures, need count sensor updates, tell me code example how count sensor updates!
decalre global variable in activity count_events.
private int count_events=0;
then in onsensorchanged(sensorevent event) function make following changes:
public void onsensorchanged(sensorevent event) { sensor mysensor=event.sensor; int type=mysensor.gettype(); if(type==sensor.type_proximity ) { count_events++; }
Comments
Post a Comment