Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
SedentaryBehaviourApplication
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Peter Joseph De Jonckheere CESM2014
SedentaryBehaviourApplication
Commits
61766b9c
Commit
61766b9c
authored
6 years ago
by
Peter Joseph De Jonckheere CESM2014
Browse files
Options
Downloads
Patches
Plain Diff
Half a class more.
parent
dbe1b673
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/main/java/com/notificationFramework/stimulusStrategy/SigMotionDetect.java
+40
-0
40 additions, 0 deletions
...tificationFramework/stimulusStrategy/SigMotionDetect.java
with
40 additions
and
0 deletions
src/main/java/com/notificationFramework/stimulusStrategy/SigMotionDetect.java
+
40
−
0
View file @
61766b9c
...
...
@@ -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
);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment