Switch branches/tags
Nothing to show
Find file History
Latest commit b09b27e Nov 8, 2016

ReadMe.md

ActiGraph Link SDK

Requirements

Installation

  1. Download the following files and include them in your project

Android Studio Instructions

  • Download .aar file
  • Add file to libs folder located under your Project Name/Your app name/libs/
  • File > New > New Module > Import .aar/Jar > Browse for libs/agdevicelibrary-release.aar
  • Add Import Statement import actigraph.deviceapi.*;

Documentation

Usage

JSON Configuration Examples

The following are possible JSON configurations that can be sent to the device using the following method

public void ConfigureDevice(String config);

RAW Configuration Request

{
	"raw" : {
		"stream": true 
	}
}

RAW Configuration Response

This response will be received multiple times until a RAW Configuration request to disable streaming is received or the device is disconnected.

{
	"raw" : {
		"device" : "TAS1D12345678",
		"timestamp" : "1427113646",
		"acceleration" : [
			{
				"x" : 0.0003,
				"y" : 1.0002,
				"z" : 0.0001
			},
			{
				"x" : 0.0001,
				"y" : 0.0003,
				"z" : 1.0001
			} 
		]
	}
}

IMU Configuration Request

{
	"imu" : {
		"accelerometer": false,
		"gyroscope": true,
		"magnetometer": false,
		"temperature": true
	}
}

IMU Configuration Response

There is no response from the device upon successful configuration of IMU states.

Epoch Configuration Request

{
	"epoch" : {
		"startDateTime": "07-21-2015 04:05:00",
		"stopDateTime": "07-21-2015 04:06:00"
	}
}

Epoch Configuration Response

After requesting to download epoch information from the device, there will be progress updates of the download followed by a final response which will have all the epoch information provided.

{ 
	"epochDownload" : {
		"state" : "started",
		"progress" : 0 
	} 
}

{ 
	"epochDownload" : {
		"state" : "downloading",
		"progress" : 55 
	} 
}

{ 
	"epochDownload" : {
		"state" : "completed",
		"progress" : 100 
	} 
}

{
	"epoch" : {
		"startdatetime" : "07-21-2015 04:05:00",
		"stopdatetime" : "07-21-2015 04:06:00",
		"epochData" : [{
			"timestamp": "07-07-2015 04:05:00",
			"xCounts": 20,
			"yCounts": 100,
			"zCounts": 30,
			"steps": 0,
			"heartRate": 0,
			"wearDetect": 1
		},
		{
			"timestamp": "07-07-2015 04:06:00",
			"xCounts": 10,
			"yCounts": 40,
			"zCounts": 200,
			"steps": 0,
			"heartRate": 0,
			"wearDetect": 1
		}]
	}
}

Other JSON Responses

The following are other responses that can be received based off the various states of the SDK or if an error has occured.

Device found during scan

{
	"device" : "TAS1A00000001"
}

Devices found after scan completed

{
	"devices" : [
		"TAS1A14758923",
		"TAS1D03845638",
		"TAS1D83493233"
	]
}

Device Connected / Disconnected

{
	"deviceConnected" : "TAS1A14758923"
}

{
	"deviceDisconnected" : "TAS1A14758923"
}

SDK Errors

{
	"error" : {
		"code" : 3,
		"description" : "Unrecognized Configuration",
		"extra" : "inu, mageenetometer" 
	}
}

Code Descriptions

0 - No Device Connected
1 - Device Not Found
2 - Device Enumeration in Progress
3 - Unrecognized Configuration
4 - SDK Access Disabled
5 - Device Connection Failed
6 - Device Is Busy
7 - Wireless Transfer Error
8 - Epoch Download Error
9 - Date Format Error

Sample Application

Actigraph has developed an open-source sample application to help developers get started with the SDK. Screen images are provided in this section to illustrate the sample app.

Example application and library created using Android Studio 1.1.0

Sample app screen capture of device enumeration

Sample app screen capture of device enumeration

Sample app screen capture of device status

Sample app screen capture of device status

Sample app screen capture of raw data streaming

Sample app screen capture of raw data streaming