Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
minoskt committed Jul 29, 2015
2 parents f7298a5 + 7d88f75 commit f180e4d
Show file tree
Hide file tree
Showing 56 changed files with 940 additions and 594 deletions.
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,13 @@
# Changelog

### 0.2.0
- Added support for Bluetooth sensor module.
- DataInterface method getDataInString() has been renamed to getDataInCSV()
- SKDataInterface has been renamed to SKSensorData
- Added getSensorModuleType() to SKSensorData
- Added SK prefix to all source files
- Added support for Android Studio 1.3
- Updated Build Tools version to 22.0.1

### 0.1.0
- Initial Release
23 changes: 12 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ An Android library that provides Continuous Sensing functionality to your applic

## Supported Sensors

The following sensor modules are currently supported in SensingKit-Android, (listed in [SensorModuleType](SensingKitLib/src/main/java/org/sensingkit/sensingkitlib/modules/SensorModuleType.java) enum):
The following sensor modules are currently supported in SensingKit-Android, (listed in [SKSensorModuleType](SensingKitLib/src/main/java/org/sensingkit/sensingkitlib/modules/SKSensorModuleType.java) enum):

- Accelerometer
- Gravity
Expand All @@ -23,6 +23,7 @@ The following sensor modules are currently supported in SensingKit-Android, (lis
- Screen Status
- Audio Recorder
- Audio Level
- Bluetooth

## Configuring the Library

Expand Down Expand Up @@ -51,9 +52,9 @@ repositories {
```
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'org.sensingkit:SensingKitLib-release:0.1@aar'
compile 'com.android.support:appcompat-v7:21.0.3
compile 'com.google.android.gms:play-services-location:6.5.87'
compile 'org.sensingkit:SensingKitLib-release@aar'
compile 'com.android.support:appcompat-v7:22.2.1
compile 'com.google.android.gms:play-services-location:7.5.0'
}
```

Expand All @@ -72,17 +73,17 @@ SensingKitLibInterface mSensingKitLib = SensingKitLib.getSensingKitLib(this);
- Register a sensor module (e.g. a Light sensor) as shown bellow:

```java
mSensingKitLib.registerSensorModule(SensorModuleType.LIGHT);
mSensingKitLib.registerSensorModule(SKSensorModuleType.LIGHT);
```


- Subscribe a sensor data listener:

```java
mSensingKitLib.subscribeSensorDataListener(SensorModuleType.LIGHT, new SKSensorDataListener() {
mSensingKitLib.subscribeSensorDataListener(SKSensorModuleType.LIGHT, new SKSensorDataListener() {
@Override
public void onDataReceived(final SensorModuleType moduleType, final DataInterface moduleData) {
System.out.println(moduleData); // Print data
public void onDataReceived(final SKSensorModuleType moduleType, final SKSensorData sensorData) {
System.out.println(sensorData.getDataInCSV()); // Print data in CSV format
}
});
```
Expand All @@ -91,16 +92,16 @@ mSensingKitLib.subscribeSensorDataListener(SensorModuleType.LIGHT, new SKSensorD
- You can cast the data object into the actual sensor data object in order to access all the sensor data properties:

```java
LightData lightData = (LightData)moduleData;
SKLightData lightData = (SKLightData)sensorData;
```



- You can Start and Stop the Continuous Sensing using the following commands:

```java
mSensingKitLib.startContinuousSensingWithSensor(SensorModuleType.LIGHT);
mSensingKitLib.stopContinuousSensingWithSensor(SensorModuleType.LIGHT);
mSensingKitLib.startContinuousSensingWithSensor(SKSensorModuleType.LIGHT);
mSensingKitLib.stopContinuousSensingWithSensor(SKSensorModuleType.LIGHT);
```


Expand Down
2 changes: 1 addition & 1 deletion SensingKit-Android.iml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
</configuration>
</facet>
</component>
<component name="NewModuleRootManager" inherit-compiler-output="true">
<component name="NewModuleRootManager" LANGUAGE_LEVEL="JDK_1_7" inherit-compiler-output="true">
<exclude-output />
<content url="file://$MODULE_DIR$">
<excludeFolder url="file://$MODULE_DIR$/.gradle" />
Expand Down
8 changes: 5 additions & 3 deletions SensingKitLib/SensingKitLib.iml
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,12 @@
<option name="SELECTED_TEST_ARTIFACT" value="_android_test_" />
<option name="ASSEMBLE_TASK_NAME" value="assembleDebug" />
<option name="COMPILE_JAVA_TASK_NAME" value="compileDebugSources" />
<option name="SOURCE_GEN_TASK_NAME" value="generateDebugSources" />
<option name="ASSEMBLE_TEST_TASK_NAME" value="assembleDebugAndroidTest" />
<option name="COMPILE_JAVA_TEST_TASK_NAME" value="compileDebugAndroidTestSources" />
<option name="TEST_SOURCE_GEN_TASK_NAME" value="generateDebugAndroidTestSources" />
<afterSyncTasks>
<task>generateDebugAndroidTestSources</task>
<task>generateDebugSources</task>
</afterSyncTasks>
<option name="ALLOW_USER_CONFIGURATION" value="false" />
<option name="MANIFEST_FILE_RELATIVE_PATH" value="/src/main/AndroidManifest.xml" />
<option name="RES_FOLDER_RELATIVE_PATH" value="/src/main/res" />
Expand All @@ -25,7 +27,7 @@
</configuration>
</facet>
</component>
<component name="NewModuleRootManager" inherit-compiler-output="false">
<component name="NewModuleRootManager" LANGUAGE_LEVEL="JDK_1_7" inherit-compiler-output="false">
<output url="file://$MODULE_DIR$/build/intermediates/classes/debug" />
<output-test url="file://$MODULE_DIR$/build/intermediates/classes/androidTest/debug" />
<exclude-output />
Expand Down
6 changes: 3 additions & 3 deletions SensingKitLib/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@ apply plugin: 'com.android.library'

android {
compileSdkVersion 22
buildToolsVersion "22"
buildToolsVersion "22.0.1"

defaultConfig {
minSdkVersion 16
targetSdkVersion 22
versionCode 0
versionName "0.1"
versionCode 1
versionName "0.2.0"
}
buildTypes {
release {
Expand Down
2 changes: 1 addition & 1 deletion SensingKitLib/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

<meta-data android:name="com.google.android.gms.version" android:value="@integer/google_play_services_version" />

<service android:name=".modules.ActivityRecognitionIntentService" />
<service android:name=".modules.SKActivityRecognitionIntentService" />

</application>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,10 @@

package org.sensingkit.sensingkitlib;

import org.sensingkit.sensingkitlib.model.data.DataInterface;
import org.sensingkit.sensingkitlib.modules.SensorModuleType;
import org.sensingkit.sensingkitlib.data.SKSensorData;

public interface SKSensorDataListener {

void onDataReceived(final SensorModuleType moduleType, final DataInterface moduleData);
void onDataReceived(final SKSensorModuleType moduleType, final SKSensorData sensorData);

}
Loading

0 comments on commit f180e4d

Please sign in to comment.