All Projects → SensingKit → Sensingkit Ios

SensingKit / Sensingkit Ios

Licence: lgpl-3.0
An iOS framework that provides Mobile Sensing functionality to your apps.

Labels

Projects that are alternatives of or similar to Sensingkit Ios

Airmonitor
Air quality monitor based on STM32 & MT7681
Stars: ✭ 10 (-89.25%)
Mutual labels:  sensor
Hb Uni Sen Wea
Selbstbau-Wetterstation für HomeMatic
Stars: ✭ 51 (-45.16%)
Mutual labels:  sensor
Ha Average
Average Sensor for Home Assistant
Stars: ✭ 79 (-15.05%)
Mutual labels:  sensor
Bmp085
A node.js module for reading a BMP085 barometer sensor.
Stars: ✭ 11 (-88.17%)
Mutual labels:  sensor
Mops Vida Pm Watchdog
MOPS·VIDA PM Watchdog for Web Bluetooth
Stars: ✭ 42 (-54.84%)
Mutual labels:  sensor
Pysmartnode
Micropython Smarthome framework
Stars: ✭ 58 (-37.63%)
Mutual labels:  sensor
Zx gesture sensor smd
The ZX Distance and Gesture Sensor is a touchless sensor that is capable of looking for simple gestures.
Stars: ✭ 5 (-94.62%)
Mutual labels:  sensor
Androidwearmotionsensors
Using the accelerometer and gyroscope on an Android Wear device
Stars: ✭ 91 (-2.15%)
Mutual labels:  sensor
Py Sds011
Python 3 interface to the SDS011 air particulate density sensor.
Stars: ✭ 48 (-48.39%)
Mutual labels:  sensor
Pzem 004t V30
Arduino library for the Updated PZEM-004T v3.0 Power and Energy meter
Stars: ✭ 78 (-16.13%)
Mutual labels:  sensor
Phonepi sampleserver
Companion servers in Node and Python for the PhonePi Sensor Streamer apps.
Stars: ✭ 28 (-69.89%)
Mutual labels:  sensor
Hydroponic Automation
A program to monitor and control 8 variables of a hydroponic gardening system
Stars: ✭ 38 (-59.14%)
Mutual labels:  sensor
Opensensemap
Platform for storing and exploring sensor data
Stars: ✭ 69 (-25.81%)
Mutual labels:  sensor
Temper Hum Hid
🌡 TemperHum HID query API in C
Stars: ✭ 10 (-89.25%)
Mutual labels:  sensor
Sos
52°North Sensor Observation Service
Stars: ✭ 81 (-12.9%)
Mutual labels:  sensor
Jetsonjs
Embed a JavaScript/WebGL application on a Nvidia Jetson TX2 and stream the results through websockets. It does not rely on CUDA/Jetpack. HDMI touchscreen, virtual keyboard, GPIO control, wifi config are included.
Stars: ✭ 18 (-80.65%)
Mutual labels:  sensor
Edgeml
This repository provides code for machine learning algorithms for edge devices developed at Microsoft Research India.
Stars: ✭ 1,093 (+1075.27%)
Mutual labels:  sensor
Exnn
An Elixir Evolutive Neural Network framework à la G.Sher
Stars: ✭ 93 (+0%)
Mutual labels:  sensor
Ehal
Embedded Hardware Abstraction Library
Stars: ✭ 84 (-9.68%)
Mutual labels:  sensor
Ultrasonic
Minimalist library for Ultrasonic Module HC-SR04, PING))) and Seeed SEN136B5B to Arduino
Stars: ✭ 77 (-17.2%)
Mutual labels:  sensor

SensingKit-iOS Library

An iOS library that provides Continuous Sensing functionality to your applications. For more information, please refer to the project website.

Supported Sensors

The following mobile sensors are currently supported in SensingKit-iOS, (listed in SKSensorType enum):

  • Accelerometer
  • Gyroscope
  • Magnetometer
  • Device Motion (senses Attitude, Gravity, User Acceleration, Magnetic Field, Rotation)
  • Motion Activity
  • Pedometer
  • Altimeter
  • Battery
  • Location
  • Heading
  • iBeacon™ Proximity
  • Eddystone™ Proximity
  • Microphone

Installing the Library

You can easily install SensingKit using CocoaPods, a popular dependency manager for Cocoa projects. For installing CocoaPods, use the following command:

$ gem install cocoapods

To integrate SensingKit into your Xcode project, specify it in your Podfile:

target <MyApp> do
  # Uncomment this line if you're using Swift or would like to use dynamic frameworks
  use_frameworks!

  pod 'SensingKit'
  # For the latest development version, please use:
  # pod 'SensingKit', :git => 'https://github.com/SensingKit/SensingKit-iOS.git', :branch => 'next'

end

Then, run the following command:

$ pod install

For more information about CocoaPods, visit https://cocoapods.org.

Using the Library

Import and init SensingKit as shown below:

Objective-C

#import <SensingKit/SensingKit.h>

@property (nonatomic, strong) SensingKitLib *sensingKit;

- (void)viewDidLoad {
    [super viewDidLoad];

    self.sensingKit = [SensingKitLib sharedSensingKitLib];
}

Swift

import SensingKit

let sensingKit = SensingKitLib.shared()

Check if a sensor is available in the device:

Objective-C

if ([self.sensingKit isSensorAvailable:Battery]) {
    // You can access the sensor
}

Swift

if sensingKit.isSensorAvailable(SKSensorType.Battery) {
    // You can access the sensor
}

Register a sensor (e.g. a Battery sensor) as shown below:

Objective-C

[self.sensingKit registerSensor:Battery error:NULL];

Swift

do {
    try sensingKit.register(SKSensorType.Battery)
}
catch {
    // Handle error
}

Subscribe a sensor data handler. You can cast the data object into the actual sensor data object in order to access all the sensor data properties:

Objective-C

[self.sensingKit subscribeToSensor:Battery
                       withHandler:^(SKSensorType sensorType, SKSensorData *sensorData, NSError *error) {

        if (!error) {
            SKBatteryData *batteryData = (SKBatteryData *)sensorData;
            NSLog(@"Battery Level: %f", batteryData.level);
        }
    } error:NULL];

Swift

do {
    try sensingKit.subscribe(to: SKSensorType.Battery, withHandler: { (sensorType, sensorData, error) in

        if (error == nil) {
            let batteryData = sensorData as! SKBatteryData
            print("Battery Level: \(batteryData)")
        }
    })
}
catch {
    // Handle error
}

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

Objective-C

// Start
[self.sensingKit startContinuousSensingWithSensor:Battery error:NULL];

// Stop
[self.sensingKit stopContinuousSensingWithSensor:Battery error:NULL];

Swift

// Start
do {
    try sensingKit.startContinuousSensing(with:SKSensorType.Battery)
}
catch {
    // Handle error
}

// Stop
do {
    try sensingKit.stopContinuousSensing(with:SKSensorType.Battery)
}
catch {
    // Handle error
}

For a complete description of our API, please refer to the documentation page of SensingKit website.

Required Info.plist Keys

Depending on the used sensor and its configuration, some keys with a user-friendly description should be included in the info.plist application file:

Microphone

  • NSMicrophoneUsageDescription

Eddystone

  • NSBluetoothPeripheralUsageDescription

Location

  • NSLocationAlwaysUsageDescription
  • NSLocationWhenInUseUsageDescription
  • NSLocationAlwaysAndWhenInUseUsageDescription

MotionActivity

  • NSMotionUsageDescription

License

Copyright (c) 2014. Kleomenis Katevas
Kleomenis Katevas, [email protected]

This file is part of SensingKit-iOS library.
For more information, please visit https://www.sensingkit.org

SensingKit-iOS is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.

SensingKit-iOS is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License
along with SensingKit-iOS.  If not, see <http://www.gnu.org/licenses/>.

This library is available under the GNU Lesser General Public License 3.0, allowing to use the library in your applications.

If you want to help with the open source project, contact [email protected].

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].