All Projects → Welltory → measure-stress-hrv-android

Welltory / measure-stress-hrv-android

Licence: other
Get stress measurement results in your Android app using Welltory heart rate variability algorithms

Programming Languages

java
68154 projects - #9 most used programming language

Projects that are alternatives of or similar to measure-stress-hrv-android

TestHrv
Heart rate variability app for Garmin smartwatches
Stars: ✭ 44 (+83.33%)
Mutual labels:  hrv, heart-rate-variability, heart-rate-monitor
Meditate
Meditation app for Garmin smartwatches
Stars: ✭ 42 (+75%)
Mutual labels:  hrv, heart-rate-variability, heart-rate-monitor
OpenHRV
Heart rate variability (HRV) biofeedback with Polar ECG chest straps.
Stars: ✭ 37 (+54.17%)
Mutual labels:  hrv, heart-rate-variability
mhrv
Matlab toolbox for calculating Heart-Rate Variability metrics on ECG signals
Stars: ✭ 48 (+100%)
Mutual labels:  hrv, heart-rate-variability
systole
Systole: A python package for cardiac signal synchrony and analysis
Stars: ✭ 51 (+112.5%)
Mutual labels:  hrv, heart-rate-variability
pyhrv
Python toolbox for Heart Rate Variability
Stars: ✭ 172 (+616.67%)
Mutual labels:  hrv, heart-rate-variability
BioAmp-v1.5
Upside Down Lab's Biopotential Amplifier v1.5 - Buy on Tindie at https://bit.ly/BioAmp-v1_5
Stars: ✭ 27 (+12.5%)
Mutual labels:  ecg, ekg
Nettychat
基于Netty+TCP+Protobuf实现的Android IM库,包含Protobuf序列化、TCP拆包与粘包、长连接握手认证、心跳机制、断线重连机制、消息重发机制、读写超时机制、离线消息、线程池等功能。
Stars: ✭ 1,979 (+8145.83%)
Mutual labels:  heartbeat
S Tui
Terminal-based CPU stress and monitoring utility
Stars: ✭ 2,825 (+11670.83%)
Mutual labels:  stress
Cim
📲cim(cross IM) 适用于开发者的分布式即时通讯系统
Stars: ✭ 8,109 (+33687.5%)
Mutual labels:  heartbeat
Hangfire.Heartbeat
Server monitoring plugin for Hangfire.
Stars: ✭ 71 (+195.83%)
Mutual labels:  heartbeat
range3
Range Software - Finite Element Analysis
Stars: ✭ 31 (+29.17%)
Mutual labels:  stress
hornet
Hornet is a simple library for stress testing
Stars: ✭ 33 (+37.5%)
Mutual labels:  stress
devheart
Listen to Tux's heartbeat with this awesome Linux Kernel Module ❤️
Stars: ✭ 58 (+141.67%)
Mutual labels:  heartbeat
Hitchhiker-Node
Stress test node for Hitchhiker
Stars: ✭ 18 (-25%)
Mutual labels:  stress
Beats
🐠 Beats - Lightweight shippers for Elasticsearch & Logstash
Stars: ✭ 10,522 (+43741.67%)
Mutual labels:  heartbeat
HealthyPi
OBSOLETE. Replaced by https://github.com/Protocentral/protocentral-healthypi-v3
Stars: ✭ 64 (+166.67%)
Mutual labels:  ecg
fire-im
分布式IM服务,参考https://github.com/crossoverJie/cim 实现
Stars: ✭ 17 (-29.17%)
Mutual labels:  heartbeat
HellPot
HellPot is a portal to endless suffering meant to punish unruly HTTP bots.
Stars: ✭ 146 (+508.33%)
Mutual labels:  stress
flirt
Are you ready to FLIRT with your wearable data?
Stars: ✭ 41 (+70.83%)
Mutual labels:  hrv

Welltory Integration Android Demo

Welltory flow

This demo app is intended for people who want to integrate with Welltory app to collect stress, energy and other HRV data about their users. The Demo app demonstrates how your app can work with Welltory. This integration is free and it’s created to help you add value for your users who already use Welltory. Read more here

To become an integration partner - apply here

Welltory is an app that measures people’s HRV with just a smartphone camera to calculate their stress and energy levels. You can redirect users to our app and direct them back to your app with measurement results. Welltory integration will allow you to collect data of the following parameters:

  • Stress (Welltory's proprietary algorithm trained on millions of measurements)
  • Energy (Welltory's proprietary algorithm trained on millions of measurements)
  • Productivity index (Welltory's proprietary algorithm trained on millions of measurements)
  • RMSSD index
  • SDNN index
  • Total power

This demo is to demonstrate:

  • how the user is navigated from your app to the App Store,
  • how the measurement is taken,
  • a request asking the user to share the results of the measurement with your app,
  • the return to your application,
  • a sample of results presentation, and also the source code of the integration.

Continue reading for installation.

Table of Contents

  1. How to install
    1. Requirements
    2. Installation guide
  2. Example usage
  3. Integration
  4. Measurement request
    1. Measurement request link and parameters
    2. Package visibility
  5. Stress results overview
    1. Configure your app to add it the list of approved domains
    2. Configure your website to host the 'apple-app-site-association' file
  6. Stress results processing
  7. Demo Applications
  8. Questions
  9. License and author info

How to install

Requirements:

  • Android Studio 3.5 or later

No additional tools required.

Installation guide:

  • Clone the repository master brunch using git clone https://github.com/Welltory/measure-stress-hrv-android.git
  • Open project directory with the Android Studio 3.5+
  • Run the project

Example usage

  1. In the DDS Example application press "Measure now" button to start measurement

Measure now

  1. Welltory application will launch and automatically starts a measurement

Measurement process

  1. After measurement complete, results sharing window will appear

Measurement result

  1. After user presses "ok, let's do it" button measurement results and user controll pull back to the DDS application

Presenting result

Integration

Welltory doesn't provide any integration SDKs, all applications interaction are performed with intents.

You should start your integration filling out an Integration Request Form.

Please send us a live chat message on our website if you have any questions.

Measurement request

To start a measurement you should send URI intent

Important: The intent link changes depending on whether Welltory is installed or not.

Package visibility

https://developer.android.com/training/package-visibility

For apps with targetSdkVersion >= 30 you should add the following code to AndroidManifest.xml:

<queries>
        <intent>
            <action android:name="android.intent.action.VIEW" />
            <data android:scheme="welltory" />
        </intent>
</queries>

Measurement request link

For the very first measurement from your application, launch the following link: https://play.google.com/store/apps/details?id=com.welltory.client.android&referrer=<utf_8_encoded_params>

Where the referrer contains:

  • source - Your application name. Will be displayed in Welltory interfaces.
  • callback - The application package and activity name divided with "/" symbol, to pass result data. com.welltory.dds.android/com.welltory.dds.android.MainActivity, for example
  • other parameters - [optionally] list of parameters to pass with measurement results. If you want to pass your own parameters to the measurement result, you should add them as query parameters to the URI

Important: we DON’T save parameters in a database
Important: Activity should have android:exported=”true” configuration

It will take the user to the measurement screen in case Welltory is installed, or redirect them to Google Play page to install it.

Example: https://play.google.com/store/apps/details?id=com.welltory.client.android&referrer=source%3DYourApp%26callback%3Dcom.welltory.dds.android%2Fcom.welltory.dds.android.MainActivity%26param1%3Dtest_param1


Every following measurement request should be done using direct Welltory link: welltory://branch/Measurement/Start/<utf_8_encoded_params>

Where the utf_8_encoded_params contains:

  • source - Your application name. Will be displayed in Welltory interfaces.
  • callback - The application package and activity name divided with "/" symbol, to pass result data. com.welltory.dds.android/com.welltory.dds.android.MainActivity, for example
  • other parameters - [optionally] list of parameters to pass with measurement results. If you want to pass your own parameters to the measurement result, you should add them as query parameters to the URI

Important: we DON’T save parameters in a database
Important: Activity should have android:exported=”true” configuration

Example: welltory://branch/Measurement/Start/source%3DYourApp%26callback%3Dcom.welltory.dds.android%2Fcom.welltory.dds.android.MainActivity%26param1%3Dtest_param1

Important: Execute Intent with FLAG_ACTIVITY_NEW_TASK and FLAG_ACTIVITY_CLEAR_TOP flags, to avoid a duplication of partner’s application instances.

Examples:

String callBackActivity = String.format(Locale.getDefault(), "%s/%s",
       activity.getPackageName(), activity.getClass().getName());
String params = String.format(Locale.getDefault(),
       "source=%s&callback=%s&param1=test_param1", "YourApp", callBackActivity);
Intent intent = null;
try {
   String encodedParams = URLEncoder.encode(params, "UTF-8");
   intent = new Intent(Intent.ACTION_VIEW, Uri.parse("welltory://branch/Measurement/Start/" + encodedParams));
   if (intent.resolveActivity(activity.getPackageManager()) == null) {
       intent = new Intent(Intent.ACTION_VIEW, Uri.parse("https://play.google.com/store/apps/details?id=com.welltory.client.android&referrer=" + encodedParams));
   }
} catch (UnsupportedEncodingException e) {
   e.printStackTrace();
}
if (intent != null) {
   intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TOP);
   activity.startActivity(intent);
}

Stress results overview

After the user data has been processed, Welltory application will use your callback activity to send measurement results to your application. Welltory will put the following parameters into intent extras:

name type description
stress Float (0.0 - 1.0) user's stress %
energy Float (0.0 - 1.0) user's energy %
productivity Float (0.0 - 1.0) user's productivity %
rmssd Float user's rmssd index
sdnn Float user's sdnn index
power Float user's power index
token String Measurement share token. It allows to open a measurement webpage https://app.welltory.com/share-measurement?token=
productivity_c String Productivity parameter interpretation color
energy_c String Energy parameter interpretation color
stress_c String Stress parameter interpretation color
other parameters String Your custom parameters with keys and values you passed with URI

Colours:

  • green - Good
  • yellow - Normal
  • red - Bad
  • unknown - Unknown

Stress results processing

After startActivity is called, partner’s application should expect for results in onNewIntent or onCreate function (in case Android kills application's activity).
Measurement results could be fetched from the Intent by calling Intent.getFloatExta

Example:

@Override
protected void onNewIntent(Intent intent) {
	super.onNewIntent(intent);
	resultView.setText(parseIntent(intent));
}

private String parseIntent(Intent data) {
	if (data != null && data.hasExtra("stress")) {
    	return String.format(Locale.getDefault(), "productivity=%s\nrmssd=%s\nenergy=%s\npower=%s\nstress=%s\nsdnn=%s",
            	data.getFloatExtra("productivity", -1),
            	data.getFloatExtra("rmssd", -1),
            	data.getFloatExtra("energy", -1),
            	data.getFloatExtra("power", -1),
            	data.getFloatExtra("stress", -1),
            	data.getFloatExtra("sdnn", -1));
	} else {
    	return null;
	}
}

Demo Applications

This repository contains a working Demo DDS application.

Questions?

If you have questions about the partnership, send us a live chat message on our website

License and author info

Welltory Integration Android Example

The MIT License (MIT)

Copyright (c) 2019 Welltory Integration Android

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
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].