Skip to content

Commit 5bae290

Browse files
committed
Merge branch 'develop'
2 parents e6f1aef + 46cf9c0 commit 5bae290

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

63 files changed

+4270
-13
lines changed

.gitignore

Lines changed: 21 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,35 @@
1-
# Built application files
1+
# Android Studio
2+
.gradle
3+
/local.properties
4+
/.idea
5+
/.idea/workspace.xml
6+
.DS_Store
7+
/build
8+
9+
#built application files
210
*.apk
311
*.ap_
412

5-
# Files for the Dalvik VM
13+
# files for the dex VM
614
*.dex
715

816
# Java class files
917
*.class
1018

11-
# Generated files
19+
# generated files
1220
bin/
1321
gen/
1422

15-
# Gradle files
16-
.gradle/
17-
build/
18-
1923
# Local configuration file (sdk path, etc)
2024
local.properties
2125

22-
# Proguard folder generated by Eclipse
23-
proguard/
26+
# Windows thumbnail db
27+
Thumbs.db
28+
29+
# OSX files
30+
.DS_Store
31+
32+
# Eclipse project files
33+
.classpath
34+
.project
35+

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -162,4 +162,4 @@ General Public License ever published by the Free Software Foundation.
162162
whether future versions of the GNU Lesser General Public License shall
163163
apply, that proxy's public statement of acceptance of any version is
164164
permanent authorization for you to choose that version for the
165-
Library.
165+
Library.

README.md

Lines changed: 133 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,134 @@
1-
SensingKit-Android
2-
==================
1+
# SensingKit-Android Library
32

4-
An Android library that provides Continuous Sensing functionality to your applications.
3+
An Android library that provides Continuous Sensing functionality to your applications. For more information, please refer to the [project website](http://www.sensingkit.org).
4+
5+
6+
## Supported Sensors
7+
8+
The following sensor modules are currently supported in SensingKit-Android, (listed in [SensorModuleType](SensingKitLib/src/main/java/org/sensingkit/sensingkitlib/modules/SensorModuleType.java) enum):
9+
10+
- Accelerometer
11+
- Gravity
12+
- Linear Acceleration
13+
- Gyroscope
14+
- Rotation
15+
- Magnetometer
16+
- Ambient Temperature
17+
- Step Detector
18+
- Step Counter
19+
- Light
20+
- Location
21+
- Activity
22+
- Battery
23+
- Screen Status
24+
- Audio Recorder
25+
- Audio Level
26+
27+
## Configuring the Library
28+
29+
- Build the library using the command:
30+
31+
```
32+
./gradlew build
33+
```
34+
35+
- Create an app/libs directory inside your project and copy the generated SensingKitLib/build/outputs/aar/SensingKitLib-release.aar (or the equivalent debug) file there.
36+
37+
- Edit your app/build.gradle file and add a flatDir entry as shown bellow:
38+
39+
```
40+
repositories {
41+
mavenCentral()
42+
flatDir {
43+
dirs 'libs'
44+
}
45+
}
46+
```
47+
48+
49+
- In the same app/build.gradle file, add SensingKitLib as a dependency as shown below:
50+
51+
```
52+
dependencies {
53+
compile fileTree(dir: 'libs', include: ['*.jar'])
54+
compile 'org.sensingkit:SensingKitLib-release:0.1@aar'
55+
compile 'com.android.support:appcompat-v7:21.0.3’
56+
compile 'com.google.android.gms:play-services-location:6.5.87'
57+
}
58+
```
59+
60+
61+
## How to Use this Library
62+
63+
- import and init SensingKit into your Activity class as shown bellow:
64+
65+
```java
66+
import org.sensingkit.sensingkitlib.SensingKitLib;
67+
68+
SensingKitLibInterface mSensingKitLib = SensingKitLib.getSensingKitLib(this);
69+
```
70+
71+
72+
- Register a sensor module (e.g. a Light sensor) as shown bellow:
73+
74+
```java
75+
mSensingKitLib.registerSensorModule(SensorModuleType.LIGHT);
76+
```
77+
78+
79+
- Subscribe a sensor data listener:
80+
81+
```java
82+
mSensingKitLib.subscribeSensorDataListener(SensorModuleType.LIGHT, new SKSensorDataListener() {
83+
@Override
84+
public void onDataReceived(final SensorModuleType moduleType, final DataInterface moduleData) {
85+
System.out.println(moduleData); // Print data
86+
}
87+
});
88+
```
89+
90+
91+
- You can cast the data object into the actual sensor data object in order to access all the sensor data properties:
92+
93+
```java
94+
LightData lightData = (LightData)moduleData;
95+
```
96+
97+
98+
99+
- You can Start and Stop the Continuous Sensing using the following commands:
100+
101+
```java
102+
mSensingKitLib.startContinuousSensingWithSensor(SensorModuleType.LIGHT);
103+
mSensingKitLib.stopContinuousSensingWithSensor(SensorModuleType.LIGHT);
104+
```
105+
106+
107+
For a complete description of our API, please refer to the [project website](http://www.sensingkit.org).
108+
109+
## License
110+
111+
```
112+
Copyright (c) 2014. Queen Mary University of London
113+
Kleomenis Katevas, k.katevas@qmul.ac.uk.
114+
115+
This file is part of SensingKit-Android library.
116+
For more information, please visit http://www.sensingkit.org.
117+
118+
SensingKit-Android is free software: you can redistribute it and/or modify
119+
it under the terms of the GNU Lesser General Public License as published by
120+
the Free Software Foundation, either version 3 of the License, or
121+
(at your option) any later version.
122+
123+
SensingKit-Android is distributed in the hope that it will be useful,
124+
but WITHOUT ANY WARRANTY; without even the implied warranty of
125+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
126+
GNU Lesser General Public License for more details.
127+
128+
You should have received a copy of the GNU Lesser General Public License
129+
along with SensingKit-Android. If not, see <http://www.gnu.org/licenses/>.
130+
```
131+
132+
This library is available under the GNU Lesser General Public License 3.0, allowing to use the library in your applications.
133+
134+
If you want to help with the open source project, contact hello@sensingkit.org.

SensingKit-Android.iml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<module external.linked.project.id="SensingKit-Android" external.linked.project.path="$MODULE_DIR$" external.root.project.path="$MODULE_DIR$" external.system.id="GRADLE" external.system.module.group="" external.system.module.version="unspecified" type="JAVA_MODULE" version="4">
3+
<component name="FacetManager">
4+
<facet type="java-gradle" name="Java-Gradle">
5+
<configuration>
6+
<option name="BUILD_FOLDER_PATH" value="$MODULE_DIR$/build" />
7+
<option name="BUILDABLE" value="false" />
8+
</configuration>
9+
</facet>
10+
</component>
11+
<component name="NewModuleRootManager" inherit-compiler-output="true">
12+
<exclude-output />
13+
<content url="file://$MODULE_DIR$">
14+
<excludeFolder url="file://$MODULE_DIR$/.gradle" />
15+
</content>
16+
<orderEntry type="inheritedJdk" />
17+
<orderEntry type="sourceFolder" forTests="false" />
18+
</component>
19+
</module>

SensingKitLib/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
/build

SensingKitLib/SensingKitLib.iml

Lines changed: 102 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,102 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<module external.linked.project.id=":SensingKitLib" external.linked.project.path="$MODULE_DIR$" external.root.project.path="$MODULE_DIR$/.." external.system.id="GRADLE" external.system.module.group="SensingKit-Android" external.system.module.version="unspecified" type="JAVA_MODULE" version="4">
3+
<component name="FacetManager">
4+
<facet type="android-gradle" name="Android-Gradle">
5+
<configuration>
6+
<option name="GRADLE_PROJECT_PATH" value=":SensingKitLib" />
7+
</configuration>
8+
</facet>
9+
<facet type="android" name="Android">
10+
<configuration>
11+
<option name="SELECTED_BUILD_VARIANT" value="debug" />
12+
<option name="SELECTED_TEST_ARTIFACT" value="_android_test_" />
13+
<option name="ASSEMBLE_TASK_NAME" value="assembleDebug" />
14+
<option name="COMPILE_JAVA_TASK_NAME" value="compileDebugSources" />
15+
<option name="SOURCE_GEN_TASK_NAME" value="generateDebugSources" />
16+
<option name="ASSEMBLE_TEST_TASK_NAME" value="assembleDebugAndroidTest" />
17+
<option name="COMPILE_JAVA_TEST_TASK_NAME" value="compileDebugAndroidTestSources" />
18+
<option name="TEST_SOURCE_GEN_TASK_NAME" value="generateDebugAndroidTestSources" />
19+
<option name="ALLOW_USER_CONFIGURATION" value="false" />
20+
<option name="MANIFEST_FILE_RELATIVE_PATH" value="/src/main/AndroidManifest.xml" />
21+
<option name="RES_FOLDER_RELATIVE_PATH" value="/src/main/res" />
22+
<option name="RES_FOLDERS_RELATIVE_PATH" value="" />
23+
<option name="ASSETS_FOLDER_RELATIVE_PATH" value="/src/main/assets" />
24+
<option name="LIBRARY_PROJECT" value="true" />
25+
</configuration>
26+
</facet>
27+
</component>
28+
<component name="NewModuleRootManager" inherit-compiler-output="false">
29+
<output url="file://$MODULE_DIR$/build/intermediates/classes/debug" />
30+
<output-test url="file://$MODULE_DIR$/build/intermediates/classes/androidTest/debug" />
31+
<exclude-output />
32+
<content url="file://$MODULE_DIR$">
33+
<sourceFolder url="file://$MODULE_DIR$/build/generated/source/r/debug" isTestSource="false" generated="true" />
34+
<sourceFolder url="file://$MODULE_DIR$/build/generated/source/aidl/debug" isTestSource="false" generated="true" />
35+
<sourceFolder url="file://$MODULE_DIR$/build/generated/source/buildConfig/debug" isTestSource="false" generated="true" />
36+
<sourceFolder url="file://$MODULE_DIR$/build/generated/source/rs/debug" isTestSource="false" generated="true" />
37+
<sourceFolder url="file://$MODULE_DIR$/build/generated/res/rs/debug" type="java-resource" />
38+
<sourceFolder url="file://$MODULE_DIR$/build/generated/res/generated/debug" type="java-resource" />
39+
<sourceFolder url="file://$MODULE_DIR$/build/generated/source/r/androidTest/debug" isTestSource="true" generated="true" />
40+
<sourceFolder url="file://$MODULE_DIR$/build/generated/source/aidl/androidTest/debug" isTestSource="true" generated="true" />
41+
<sourceFolder url="file://$MODULE_DIR$/build/generated/source/buildConfig/androidTest/debug" isTestSource="true" generated="true" />
42+
<sourceFolder url="file://$MODULE_DIR$/build/generated/source/rs/androidTest/debug" isTestSource="true" generated="true" />
43+
<sourceFolder url="file://$MODULE_DIR$/build/generated/res/rs/androidTest/debug" type="java-test-resource" />
44+
<sourceFolder url="file://$MODULE_DIR$/build/generated/res/generated/androidTest/debug" type="java-test-resource" />
45+
<sourceFolder url="file://$MODULE_DIR$/src/debug/res" type="java-resource" />
46+
<sourceFolder url="file://$MODULE_DIR$/src/debug/resources" type="java-resource" />
47+
<sourceFolder url="file://$MODULE_DIR$/src/debug/assets" type="java-resource" />
48+
<sourceFolder url="file://$MODULE_DIR$/src/debug/aidl" isTestSource="false" />
49+
<sourceFolder url="file://$MODULE_DIR$/src/debug/java" isTestSource="false" />
50+
<sourceFolder url="file://$MODULE_DIR$/src/debug/jni" isTestSource="false" />
51+
<sourceFolder url="file://$MODULE_DIR$/src/debug/rs" isTestSource="false" />
52+
<sourceFolder url="file://$MODULE_DIR$/src/main/res" type="java-resource" />
53+
<sourceFolder url="file://$MODULE_DIR$/src/main/resources" type="java-resource" />
54+
<sourceFolder url="file://$MODULE_DIR$/src/main/assets" type="java-resource" />
55+
<sourceFolder url="file://$MODULE_DIR$/src/main/aidl" isTestSource="false" />
56+
<sourceFolder url="file://$MODULE_DIR$/src/main/java" isTestSource="false" />
57+
<sourceFolder url="file://$MODULE_DIR$/src/main/jni" isTestSource="false" />
58+
<sourceFolder url="file://$MODULE_DIR$/src/main/rs" isTestSource="false" />
59+
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/res" type="java-test-resource" />
60+
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/resources" type="java-test-resource" />
61+
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/assets" type="java-test-resource" />
62+
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/aidl" isTestSource="true" />
63+
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/java" isTestSource="true" />
64+
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/jni" isTestSource="true" />
65+
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/rs" isTestSource="true" />
66+
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/assets" />
67+
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/bundles" />
68+
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/classes" />
69+
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/coverage-instrumented-classes" />
70+
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/dependency-cache" />
71+
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/dex" />
72+
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/dex-cache" />
73+
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/exploded-aar/com.android.support/support-v4/22.0.0/jars" />
74+
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/exploded-aar/com.google.android.gms/play-services-base/7.5.0/jars" />
75+
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/exploded-aar/com.google.android.gms/play-services-location/7.5.0/jars" />
76+
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/exploded-aar/com.google.android.gms/play-services-maps/7.5.0/jars" />
77+
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/incremental" />
78+
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/jacoco" />
79+
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/javaResources" />
80+
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/libs" />
81+
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/lint" />
82+
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/manifests" />
83+
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/ndk" />
84+
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/pre-dexed" />
85+
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/proguard" />
86+
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/res" />
87+
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/rs" />
88+
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/symbols" />
89+
<excludeFolder url="file://$MODULE_DIR$/build/outputs" />
90+
<excludeFolder url="file://$MODULE_DIR$/build/reports" />
91+
<excludeFolder url="file://$MODULE_DIR$/build/test-results" />
92+
<excludeFolder url="file://$MODULE_DIR$/build/tmp" />
93+
</content>
94+
<orderEntry type="jdk" jdkName="Android API 22 Platform" jdkType="Android SDK" />
95+
<orderEntry type="sourceFolder" forTests="false" />
96+
<orderEntry type="library" exported="" name="play-services-maps-7.5.0" level="project" />
97+
<orderEntry type="library" exported="" name="support-v4-22.0.0" level="project" />
98+
<orderEntry type="library" exported="" name="play-services-base-7.5.0" level="project" />
99+
<orderEntry type="library" exported="" name="support-annotations-22.0.0" level="project" />
100+
<orderEntry type="library" exported="" name="play-services-location-7.5.0" level="project" />
101+
</component>
102+
</module>

SensingKitLib/build.gradle

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
apply plugin: 'com.android.library'
2+
3+
android {
4+
compileSdkVersion 22
5+
buildToolsVersion "22"
6+
7+
defaultConfig {
8+
minSdkVersion 16
9+
targetSdkVersion 22
10+
versionCode 0
11+
versionName "0.1"
12+
}
13+
buildTypes {
14+
release {
15+
minifyEnabled false
16+
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
17+
}
18+
}
19+
}
20+
21+
dependencies {
22+
compile fileTree(dir: 'libs', include: ['*.jar'])
23+
compile 'com.google.android.gms:play-services-location:7.5.0'
24+
}

SensingKitLib/proguard-rules.pro

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
# Add project specific ProGuard rules here.
2+
# By default, the flags in this file are appended to flags specified
3+
# in /Applications/Android Studio.app/sdk/tools/proguard/proguard-android.txt
4+
# You can edit the include path and order by changing the proguardFiles
5+
# directive in build.gradle.
6+
#
7+
# For more details, see
8+
# http://developer.android.com/guide/developing/tools/proguard.html
9+
10+
# Add any project specific keep options here:
11+
12+
# If your project uses WebView with JS, uncomment the following
13+
# and specify the fully qualified class name to the JavaScript interface
14+
# class:
15+
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
16+
# public *;
17+
#}
18+
19+
-keep class * extends java.util.ListResourceBundle {
20+
protected Object[][] getContents();
21+
}
22+
23+
-keep public class com.google.android.gms.common.internal.safeparcel.SafeParcelable {
24+
public static final *** NULL;
25+
}
26+
27+
-keepnames @com.google.android.gms.common.annotation.KeepName class *
28+
-keepclassmembernames class * {
29+
@com.google.android.gms.common.annotation.KeepName *;
30+
}
31+
32+
-keepnames class * implements android.os.Parcelable {
33+
public static final ** CREATOR;
34+
}
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
2+
package="org.sensingkit.sensingkitlib">
3+
4+
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
5+
<uses-permission android:name="android.permission.WAKE_LOCK" />
6+
7+
<application android:allowBackup="true">
8+
9+
<meta-data android:name="com.google.android.gms.version" android:value="@integer/google_play_services_version" />
10+
11+
<service android:name=".modules.ActivityRecognitionIntentService" />
12+
13+
</application>
14+
15+
</manifest>

0 commit comments

Comments
 (0)