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
269f7f35
Commit
269f7f35
authored
6 years ago
by
Peter Joseph De Jonckheere CESM2014
Browse files
Options
Downloads
Patches
Plain Diff
Ready to get awareness api key
parent
51c9988b
No related branches found
Branches containing commit
Tags
vm-only
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
app.iml
+31
-19
31 additions, 19 deletions
app.iml
build.gradle
+7
-5
7 additions, 5 deletions
build.gradle
src/main/java/com/notificationFramework/stimulusStrategy/ProximitySensor.java
+32
-2
32 additions, 2 deletions
...tificationFramework/stimulusStrategy/ProximitySensor.java
with
70 additions
and
26 deletions
app.iml
+
31
−
19
View file @
269f7f35
...
@@ -117,32 +117,44 @@
...
@@ -117,32 +117,44 @@
</content>
</content>
<orderEntry
type=
"jdk"
jdkName=
"Android API 27 Platform"
jdkType=
"Android SDK"
/>
<orderEntry
type=
"jdk"
jdkName=
"Android API 27 Platform"
jdkType=
"Android SDK"
/>
<orderEntry
type=
"sourceFolder"
forTests=
"false"
/>
<orderEntry
type=
"sourceFolder"
forTests=
"false"
/>
<orderEntry
type=
"library"
name=
"com.android.support:support-media-compat-26.1.0"
level=
"project"
/>
<orderEntry
type=
"library"
name=
"com.android.support:animated-vector-drawable-27.1.1"
level=
"project"
/>
<orderEntry
type=
"library"
name=
"com.android.support:appcompat-v7-27.1.1"
level=
"project"
/>
<orderEntry
type=
"library"
name=
"com.google.android.gms:play-services-base-15.0.1"
level=
"project"
/>
<orderEntry
type=
"library"
scope=
"TEST"
name=
"junit:junit:4.12@jar"
level=
"project"
/>
<orderEntry
type=
"library"
scope=
"TEST"
name=
"junit:junit:4.12@jar"
level=
"project"
/>
<orderEntry
type=
"library"
name=
"
android.arch.lifecycle:common:1.0.0@jar
"
level=
"project"
/>
<orderEntry
type=
"library"
name=
"
com.google.android.gms:play-services-places-placereport-15.0.1
"
level=
"project"
/>
<orderEntry
type=
"library"
scope=
"TEST"
name=
"
com.
android.
support.test.espresso:espresso-core-3.0.1
"
level=
"project"
/>
<orderEntry
type=
"library"
name=
"android.
arch.core:common:1.1.0@jar
"
level=
"project"
/>
<orderEntry
type=
"library"
name=
"com.android.support
:support-fragment-26.1.0
"
level=
"project"
/>
<orderEntry
type=
"library"
scope=
"TEST"
name=
"com.android.support
.test.espresso:espresso-core-3.0.2
"
level=
"project"
/>
<orderEntry
type=
"library"
scope=
"TEST"
name=
"javax.inject:javax.inject:1@jar"
level=
"project"
/>
<orderEntry
type=
"library"
scope=
"TEST"
name=
"javax.inject:javax.inject:1@jar"
level=
"project"
/>
<orderEntry
type=
"library"
scope=
"TEST"
name=
"com.squareup:javawriter:2.1.1@jar"
level=
"project"
/>
<orderEntry
type=
"library"
scope=
"TEST"
name=
"com.squareup:javawriter:2.1.1@jar"
level=
"project"
/>
<orderEntry
type=
"library"
name=
"com.android.support:support-vector-drawable-26.1.0"
level=
"project"
/>
<orderEntry
type=
"library"
name=
"com.google.android.gms:play-services-awareness-15.0.1"
level=
"project"
/>
<orderEntry
type=
"library"
name=
"android.arch.lifecycle:runtime-1.0.0"
level=
"project"
/>
<orderEntry
type=
"library"
scope=
"TEST"
name=
"com.android.support.test:monitor-1.0.2"
level=
"project"
/>
<orderEntry
type=
"library"
name=
"com.android.support:appcompat-v7-26.1.0"
level=
"project"
/>
<orderEntry
type=
"library"
name=
"com.android.support.constraint:constraint-layout-1.1.2"
level=
"project"
/>
<orderEntry
type=
"library"
name=
"com.android.support:support-annotations:26.1.0@jar"
level=
"project"
/>
<orderEntry
type=
"library"
name=
"com.jjoe64:graphview-4.2.2"
level=
"project"
/>
<orderEntry
type=
"library"
name=
"com.android.support.constraint:constraint-layout-solver:1.0.2@jar"
level=
"project"
/>
<orderEntry
type=
"library"
name=
"com.google.android.gms:play-services-basement-15.0.1"
level=
"project"
/>
<orderEntry
type=
"library"
name=
"com.android.support:support-core-utils-26.1.0"
level=
"project"
/>
<orderEntry
type=
"library"
scope=
"TEST"
name=
"com.android.support.test:runner-1.0.2"
level=
"project"
/>
<orderEntry
type=
"library"
name=
"com.android.support.constraint:constraint-layout-1.0.2"
level=
"project"
/>
<orderEntry
type=
"library"
name=
"com.android.support:support-vector-drawable-27.1.1"
level=
"project"
/>
<orderEntry
type=
"library"
name=
"com.android.support:support-core-ui-26.1.0"
level=
"project"
/>
<orderEntry
type=
"library"
scope=
"TEST"
name=
"com.android.support.test:runner-1.0.1"
level=
"project"
/>
<orderEntry
type=
"library"
scope=
"TEST"
name=
"com.android.support.test:rules-1.0.1"
level=
"project"
/>
<orderEntry
type=
"library"
scope=
"TEST"
name=
"com.google.code.findbugs:jsr305:2.0.1@jar"
level=
"project"
/>
<orderEntry
type=
"library"
scope=
"TEST"
name=
"com.google.code.findbugs:jsr305:2.0.1@jar"
level=
"project"
/>
<orderEntry
type=
"library"
scope=
"TEST"
name=
"com.android.support.test.espresso:espresso-idling-resource-3.0.1"
level=
"project"
/>
<orderEntry
type=
"library"
name=
"android.arch.lifecycle:runtime-1.1.0"
level=
"project"
/>
<orderEntry
type=
"library"
name=
"android.arch.lifecycle:common:1.1.0@jar"
level=
"project"
/>
<orderEntry
type=
"library"
name=
"com.google.android.gms:play-services-maps-15.0.1"
level=
"project"
/>
<orderEntry
type=
"library"
scope=
"TEST"
name=
"com.android.support.test.espresso:espresso-idling-resource-3.0.2"
level=
"project"
/>
<orderEntry
type=
"library"
scope=
"TEST"
name=
"org.hamcrest:hamcrest-core:1.3@jar"
level=
"project"
/>
<orderEntry
type=
"library"
scope=
"TEST"
name=
"org.hamcrest:hamcrest-core:1.3@jar"
level=
"project"
/>
<orderEntry
type=
"library"
name=
"com.android.
support:support-compat-26.1.0
"
level=
"project"
/>
<orderEntry
type=
"library"
name=
"com.
google.
android.
gms:play-services-tasks-15.0.1
"
level=
"project"
/>
<orderEntry
type=
"library"
name=
"android.
arch.core:common:1.0.0@jar
"
level=
"project"
/>
<orderEntry
type=
"library"
name=
"
com.
android.
support:support-core-ui-27.1.1
"
level=
"project"
/>
<orderEntry
type=
"library"
scope=
"TEST"
name=
"org.hamcrest:hamcrest-library:1.3@jar"
level=
"project"
/>
<orderEntry
type=
"library"
scope=
"TEST"
name=
"org.hamcrest:hamcrest-library:1.3@jar"
level=
"project"
/>
<orderEntry
type=
"library"
name=
"com.android.support:support-compat-27.1.1"
level=
"project"
/>
<orderEntry
type=
"library"
name=
"android.arch.lifecycle:viewmodel-1.1.0"
level=
"project"
/>
<orderEntry
type=
"library"
scope=
"TEST"
name=
"org.hamcrest:hamcrest-integration:1.3@jar"
level=
"project"
/>
<orderEntry
type=
"library"
scope=
"TEST"
name=
"org.hamcrest:hamcrest-integration:1.3@jar"
level=
"project"
/>
<orderEntry
type=
"library"
name=
"
com.
android.
support:support-v4-26
.1.0"
level=
"project"
/>
<orderEntry
type=
"library"
name=
"android.
arch.lifecycle:livedata-core-1
.1.0"
level=
"project"
/>
<orderEntry
type=
"library"
scope=
"TEST"
name=
"net.sf.kxml:kxml2:2.3.0@jar"
level=
"project"
/>
<orderEntry
type=
"library"
scope=
"TEST"
name=
"net.sf.kxml:kxml2:2.3.0@jar"
level=
"project"
/>
<orderEntry
type=
"library"
name=
"com.android.support:animated-vector-drawable-26.1.0"
level=
"project"
/>
<orderEntry
type=
"library"
name=
"com.android.support:support-core-utils-27.1.1"
level=
"project"
/>
<orderEntry
type=
"library"
name=
"com.google.android.gms:play-services-location-15.0.1"
level=
"project"
/>
<orderEntry
type=
"library"
name=
"com.android.support:support-fragment-27.1.1"
level=
"project"
/>
<orderEntry
type=
"library"
name=
"com.google.android.gms:play-services-places-15.0.1"
level=
"project"
/>
<orderEntry
type=
"library"
name=
"com.android.support:support-media-compat-27.1.1"
level=
"project"
/>
<orderEntry
type=
"library"
name=
"com.android.support:support-annotations:27.1.1@jar"
level=
"project"
/>
<orderEntry
type=
"library"
name=
"com.android.support.constraint:constraint-layout-solver:1.1.2@jar"
level=
"project"
/>
<orderEntry
type=
"library"
name=
"com.android.support:support-v4-27.1.1"
level=
"project"
/>
<orderEntry
type=
"library"
name=
"android.arch.core:runtime-1.1.0"
level=
"project"
/>
</component>
</component>
</module>
</module>
\ No newline at end of file
This diff is collapsed.
Click to expand it.
build.gradle
+
7
−
5
View file @
269f7f35
...
@@ -4,7 +4,7 @@ android {
...
@@ -4,7 +4,7 @@ android {
compileSdkVersion
27
compileSdkVersion
27
defaultConfig
{
defaultConfig
{
applicationId
"com.example.pharmacy.myapplication"
applicationId
"com.example.pharmacy.myapplication"
minSdkVersion
2
1
minSdkVersion
1
9
targetSdkVersion
27
targetSdkVersion
27
versionCode
1
versionCode
1
versionName
"1.0"
versionName
"1.0"
...
@@ -21,9 +21,11 @@ android {
...
@@ -21,9 +21,11 @@ android {
}
}
dependencies
{
dependencies
{
implementation
fileTree
(
include:
[
'*.jar'
],
dir:
'libs'
)
implementation
fileTree
(
include:
[
'*.jar'
],
dir:
'libs'
)
implementation
'com.android.support:appcompat-v7:26.1.0'
implementation
'com.android.support:appcompat-v7:27.1.1'
implementation
'com.android.support.constraint:constraint-layout:1.0.2'
implementation
'com.android.support.constraint:constraint-layout:1.1.2'
implementation
'com.jjoe64:graphview:4.2.2'
implementation
'com.google.android.gms:play-services-awareness:15.0.1'
testImplementation
'junit:junit:4.12'
testImplementation
'junit:junit:4.12'
androidTestImplementation
'com.android.support.test:runner:1.0.
1
'
androidTestImplementation
'com.android.support.test:runner:1.0.
2
'
androidTestImplementation
'com.android.support.test.espresso:espresso-core:3.0.
1
'
androidTestImplementation
'com.android.support.test.espresso:espresso-core:3.0.
2
'
}
}
This diff is collapsed.
Click to expand it.
src/main/java/com/notificationFramework/stimulusStrategy/ProximitySensor.java
+
32
−
2
View file @
269f7f35
package
com.notificationFramework.stimulusStrategy
;
package
com.notificationFramework.stimulusStrategy
;
import
android.app.Service
;
import
android.app.Service
;
import
android.content.Context
;
import
android.content.Intent
;
import
android.content.Intent
;
import
android.hardware.Sensor
;
import
android.hardware.Sensor
;
import
android.hardware.SensorEvent
;
import
android.hardware.SensorEvent
;
import
android.hardware.SensorEventListener
;
import
android.hardware.SensorEventListener
;
import
android.hardware.SensorManager
;
import
android.os.IBinder
;
import
android.os.IBinder
;
import
android.support.annotation.Nullable
;
import
android.support.annotation.Nullable
;
...
@@ -13,15 +15,43 @@ import android.support.annotation.Nullable;
...
@@ -13,15 +15,43 @@ import android.support.annotation.Nullable;
*/
*/
public
class
ProximitySensor
extends
Service
implements
SensorEventListener
{
public
class
ProximitySensor
extends
Service
implements
SensorEventListener
{
static
float
proximity
;
/**
* The method which is called when the ProximitySensor service is started. Sets up the listener to
* be registered which remains constantly registered.
*
* @param intent the intent used to start this service
* @param flags additional information about this service
* @param startId the unique identifier for this service
* @return the conditions under which the OS should treat this service
* @see android.app.Service
*/
@Override
public
int
onStartCommand
(
Intent
intent
,
int
flags
,
int
startId
)
{
SensorManager
mSensorManager
=
(
SensorManager
)
this
.
getSystemService
(
Context
.
SENSOR_SERVICE
);
Sensor
proximity
=
mSensorManager
.
getDefaultSensor
(
Sensor
.
TYPE_PROXIMITY
);
mSensorManager
.
registerListener
(
this
,
proximity
,
600000000
);
return
START_STICKY
;
}
@Nullable
@Nullable
@Override
@Override
public
IBinder
onBind
(
Intent
intent
)
{
public
IBinder
onBind
(
Intent
intent
)
{
return
null
;
return
null
;
}
}
/**
* Changes the field values when a the proximity sensor reports a change.
*
* @param event the sensor event which occurred
*/
@Override
@Override
public
void
onSensorChanged
(
SensorEvent
sensorE
vent
)
{
public
void
onSensorChanged
(
SensorEvent
e
vent
)
{
proximity
=
event
.
values
[
0
];
}
}
@Override
@Override
...
...
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