Skip to content
Snippets Groups Projects
Commit 61766b9c authored by Peter Joseph De Jonckheere CESM2014's avatar Peter Joseph De Jonckheere CESM2014
Browse files

Half a class more.

parent dbe1b673
No related branches found
No related tags found
No related merge requests found
......@@ -25,21 +25,61 @@ import java.util.Random;
/**
* Created by Peter De Jonckheere on 17/01/2018.
* <p>
* The strategy which uses the significant motion sensor provided by Android in conjunction
* with the step counter sensor to determine movement and sedentary behaviour. This method is
* as accurate as the accelerometer method but requires less power as the reporting mode of
* both sensors used in this method is not as persistent as streaming. Uses the step counter in
* addition to this class as a time period for which the movement lasted was required to be
* determined.
* </p>
*/
public class SigMotionDetect extends Service implements StimulusStrategy {
/**
* The instance of the SensorManager used to handle the interfacing between the application
* and sensor hardware
*/
private SensorManager mSensorManager;
/**
* An instance of the sensor whihc will be used in this class
*/
private Sensor md;
/**
* The trigger event listener attached to the sensor
*/
private TriggerEventListener tel;
/**
* The instance of the Android OS service to handle alarms
*/
private AlarmManager am;
/**
* The previous step count as reported by the step counter sensor
*/
private float prevStepCount;
/**
* The previous timestamp of the previous report from the step counter sensor
*/
private long prevTimeStamp;
/**
* The daily record of minutes moved
*/
private int minutes;
/**
* The number of seconds moved
*/
private double seconds = 0;
/**
* The previous value of the seconds field
*/
private double prevSeconds = 0;
/**
* The previous value of the minutes field
*/
private int prevMinutes;
@Override
public int onStartCommand(Intent intent, int flags, int startId){
am = (AlarmManager) this.getSystemService(Context.ALARM_SERVICE);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment