6 |
7 | 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](#install)
8 |
9 | To become an integration partner - [apply here](https://welltory.typeform.com/to/epJ3PR)
10 |
11 |
12 | 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:
13 |
14 | * Stress (Welltory's proprietary algorithm trained on millions of measurements)
15 | * Energy (Welltory's proprietary algorithm trained on millions of measurements)
16 | * Productivity index (Welltory's proprietary algorithm trained on millions of measurements)
17 | * RMSSD index
18 | * SDNN index
19 | * Total power
20 |
21 | This demo is to demonstrate:
22 | * how the user is navigated from your app to the App Store,
23 | * how the measurement is taken,
24 | * a request asking the user to share the results of the measurement with your app,
25 | * the return to your application,
26 | * a sample of results presentation,
27 | and also the source code of the integration.
28 |
29 | Continue reading for installation.
30 |
31 | ### Table of Contents
32 | 1. [How to install](#install)
33 | 1. [Requirements](#requirements)
34 | 2. [Installation guide](#guide)
35 | 2. [Example usage](#usage)
36 | 3. [Integration](#integration)
37 | 4. [Measurement request](#request)
38 | 1. [Measurement request link and parameters](#link)
39 | 2. [Package visibility](#package_visibility)
40 | 5. [Stress results overview](#result)
41 | 1. [Configure your app to add it the list of approved domains](#configure_domain)
42 | 2. [Configure your website to host the 'apple-app-site-association' file](#configure_aasa)
43 | 6. [Stress results processing](#result_processing)
44 | 7. [Demo Applications](#demo)
45 | 8. [Questions](#questions)
46 | 9. [License and author info](#license)
47 |
48 | # How to install
49 |
50 | ### Requirements:
51 |
52 | * Android Studio 3.5 or later
53 |
54 | No additional tools required.
55 |
56 | ### Installation guide:
57 |
58 | * Clone the repository master brunch using ``` git clone https://github.com/Welltory/measure-stress-hrv-android.git ```
59 | * Open project directory with the Android Studio 3.5+
60 | * Run the project
61 |
62 | # Example usage
63 |
64 | 1. In the DDS Example application press "Measure now" button to start measurement
65 |
66 |
67 |
68 |
69 | 2. Welltory application will launch and automatically starts a measurement
70 |
71 |
72 |
73 |
74 | 3. After measurement complete, results sharing window will appear
75 |
76 |
77 |
78 |
79 | 4. After user presses "ok, let's do it" button measurement results and user controll pull back to the DDS application
80 |
81 |
82 |
83 |
84 |
85 | # Integration
86 |
87 | Welltory doesn't provide any integration SDKs, all applications interaction are performed with intents.
88 |
89 | **You should start your integration filling out an [Integration Request Form](https://welltory.typeform.com/to/epJ3PR).**
90 |
91 | Please send us a live chat message [on our website](https://welltory.com/) if you have any questions.
92 |
93 |
94 | # Measurement request
95 |
96 | To start a measurement you should send URI intent
97 |
98 | Important: The intent link changes depending on whether Welltory is installed or not.
99 |
100 | ### Package visibility
101 | https://developer.android.com/training/package-visibility
102 |
103 | For apps with **targetSdkVersion** >= 30 you should add the following code to AndroidManifest.xml:
104 | ```java
105 |
106 |
107 |
108 |
109 |
110 |
111 | ```
112 |
113 | ### Measurement request link
114 |
115 | 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=](#)
116 |
117 | Where the **referrer** contains:
118 |
119 | * source - Your application name. Will be displayed in Welltory interfaces.
120 | * 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
121 | * 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
122 |
123 | `Important: we DON’T save parameters in a database`\
124 | `Important: Activity should have android:exported=”true” configuration`
125 |
126 |
127 | It will take the user to the measurement screen in case Welltory is installed, or redirect them to Google Play page to install it.
128 |
129 | Example:
130 | [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](#)
131 |
132 | --------
133 |
134 | Every following measurement request should be done using direct Welltory link: [welltory://branch/Measurement/Start/](#)
135 |
136 |
137 | Where the **utf_8_encoded_params** contains:
138 |
139 | * source - Your application name. Will be displayed in Welltory interfaces.
140 | * 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
141 | * 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
142 |
143 | `Important: we DON’T save parameters in a database`\
144 | `Important: Activity should have android:exported=”true” configuration`
145 |
146 | Example: [welltory://branch/Measurement/Start/source%3DYourApp%26callback%3Dcom.welltory.dds.android%2Fcom.welltory.dds.android.MainActivity%26param1%3Dtest_param1](#)
147 |
148 | `Important: Execute Intent with FLAG_ACTIVITY_NEW_TASK and FLAG_ACTIVITY_CLEAR_TOP flags, to avoid a duplication of partner’s application instances.`
149 |
150 | Examples:
151 |
152 | ```java
153 |
154 | String callBackActivity = String.format(Locale.getDefault(), "%s/%s",
155 | activity.getPackageName(), activity.getClass().getName());
156 | String params = String.format(Locale.getDefault(),
157 | "source=%s&callback=%s¶m1=test_param1", "YourApp", callBackActivity);
158 | Intent intent = null;
159 | try {
160 | String encodedParams = URLEncoder.encode(params, "UTF-8");
161 | intent = new Intent(Intent.ACTION_VIEW, Uri.parse("welltory://branch/Measurement/Start/" + encodedParams));
162 | if (intent.resolveActivity(activity.getPackageManager()) == null) {
163 | intent = new Intent(Intent.ACTION_VIEW, Uri.parse("https://play.google.com/store/apps/details?id=com.welltory.client.android&referrer=" + encodedParams));
164 | }
165 | } catch (UnsupportedEncodingException e) {
166 | e.printStackTrace();
167 | }
168 | if (intent != null) {
169 | intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TOP);
170 | activity.startActivity(intent);
171 | }
172 |
173 |
174 | ```
175 |
176 |
177 | # Stress results overview
178 |
179 | After the user data has been processed, Welltory application will use your **callback** activity to send measurement results to your application.
180 | Welltory will put the following parameters into intent extras:
181 |
182 |
183 | | name | type | description |
184 | | ------ | ------ | ------ |
185 | | stress | Float (0.0 - 1.0) | user's stress % |
186 | | energy | Float (0.0 - 1.0) | user's energy % |
187 | | productivity | Float (0.0 - 1.0) | user's productivity % |
188 | | rmssd | Float | user's rmssd index |
189 | | sdnn | Float | user's sdnn index |
190 | | power | Float | user's power index |
191 | | token | String | Measurement share token. It allows to open a measurement webpage https://app.welltory.com/share-measurement?token= |
192 | | productivity_c | String | Productivity parameter interpretation color |
193 | | energy_c | String | Energy parameter interpretation color |
194 | | stress_c | String | Stress parameter interpretation color |
195 | | other parameters | String | Your custom parameters with keys and values you passed with URI
196 |
197 | Colours:
198 | * green - Good
199 | * yellow - Normal
200 | * red - Bad
201 | * unknown - Unknown
202 |
203 | # Stress results processing
204 |
205 | After `startActivity` is called, partner’s application should expect for results in `onNewIntent` or `onCreate` function (in case Android kills application's activity). \
206 | Measurement results could be fetched from the Intent by calling `Intent.getFloatExta`
207 |
208 | Example:
209 | ```java
210 | @Override
211 | protected void onNewIntent(Intent intent) {
212 | super.onNewIntent(intent);
213 | resultView.setText(parseIntent(intent));
214 | }
215 |
216 | private String parseIntent(Intent data) {
217 | if (data != null && data.hasExtra("stress")) {
218 | return String.format(Locale.getDefault(), "productivity=%s\nrmssd=%s\nenergy=%s\npower=%s\nstress=%s\nsdnn=%s",
219 | data.getFloatExtra("productivity", -1),
220 | data.getFloatExtra("rmssd", -1),
221 | data.getFloatExtra("energy", -1),
222 | data.getFloatExtra("power", -1),
223 | data.getFloatExtra("stress", -1),
224 | data.getFloatExtra("sdnn", -1));
225 | } else {
226 | return null;
227 | }
228 | }
229 | ```
230 |
231 | # Demo Applications
232 | This repository contains a working Demo DDS application.
233 |
234 |
235 | # Questions?
236 | If you have questions about the partnership, send us a live chat message [on our website](https://welltory.com/)
237 |
238 | # License and author info
239 |
240 | ```
241 | Welltory Integration Android Example
242 |
243 | The MIT License (MIT)
244 |
245 | Copyright (c) 2019 Welltory Integration Android
246 |
247 | Permission is hereby granted, free of charge, to any person obtaining a copy
248 | of this software and associated documentation files (the "Software"), to deal
249 | in the Software without restriction, including without limitation the rights
250 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
251 | copies of the Software, and to permit persons to whom the Software is
252 | furnished to do so, subject to the following conditions:
253 |
254 | The above copyright notice and this permission notice shall be included in
255 | all copies or substantial portions of the Software.
256 |
257 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
258 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
259 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
260 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
261 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
262 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
263 | THE SOFTWARE.
264 | ```
265 |
--------------------------------------------------------------------------------
/app/.gitignore:
--------------------------------------------------------------------------------
1 | /build
2 |
--------------------------------------------------------------------------------
/app/build.gradle:
--------------------------------------------------------------------------------
1 | apply plugin: 'com.android.application'
2 |
3 | android {
4 | compileSdkVersion 30
5 | buildToolsVersion "30.0.3"
6 | defaultConfig {
7 | applicationId "com.welltory.dds.android"
8 | minSdkVersion 21
9 | targetSdkVersion 30
10 | versionCode 1
11 | versionName "1.0"
12 | }
13 | buildTypes {
14 | release {
15 | minifyEnabled false
16 | proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
17 | }
18 | }
19 | }
20 |
21 | dependencies {
22 | implementation fileTree(dir: 'libs', include: ['*.jar'])
23 | implementation 'androidx.appcompat:appcompat:1.0.2'
24 | implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
25 | }
26 |
--------------------------------------------------------------------------------
/app/proguard-rules.pro:
--------------------------------------------------------------------------------
1 | # Add project specific ProGuard rules here.
2 | # You can control the set of applied configuration files using the
3 | # proguardFiles setting in build.gradle.
4 | #
5 | # For more details, see
6 | # http://developer.android.com/guide/developing/tools/proguard.html
7 |
8 | # If your project uses WebView with JS, uncomment the following
9 | # and specify the fully qualified class name to the JavaScript interface
10 | # class:
11 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview {
12 | # public *;
13 | #}
14 |
15 | # Uncomment this to preserve the line number information for
16 | # debugging stack traces.
17 | #-keepattributes SourceFile,LineNumberTable
18 |
19 | # If you keep the line number information, uncomment this to
20 | # hide the original source file name.
21 | #-renamesourcefileattribute SourceFile
22 |
--------------------------------------------------------------------------------
/app/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
33 |
34 |
35 |
--------------------------------------------------------------------------------
/app/src/main/ic_launcher-web.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/phpblackbox/measure-stress-hrv-android/a0f35d8bcbd46ee7106f5a67665afadf772aaa9d/app/src/main/ic_launcher-web.png
--------------------------------------------------------------------------------
/app/src/main/java/com/welltory/dds/android/MainActivity.java:
--------------------------------------------------------------------------------
1 |
2 | package com.welltory.dds.android;
3 |
4 | import android.content.Intent;
5 | import android.os.Bundle;
6 | import android.view.View;
7 |
8 | import androidx.appcompat.app.AppCompatActivity;
9 |
10 | public class MainActivity extends AppCompatActivity {
11 |
12 | @Override
13 | protected void onCreate(Bundle savedInstanceState) {
14 | super.onCreate(savedInstanceState);
15 | setContentView(R.layout.activity_main);
16 | parseIntent(getIntent());
17 | findViewById(R.id.button).setOnClickListener(new View.OnClickListener() {
18 | @Override
19 | public void onClick(View v) {
20 | WelltoryMeasurementUtils.startMeasurement(MainActivity.this);
21 | }
22 | });
23 | }
24 |
25 | @Override
26 | protected void onNewIntent(Intent intent) {
27 | super.onNewIntent(intent);
28 | parseIntent(intent);
29 | }
30 |
31 | private void parseIntent(Intent data) {
32 | if (data != null && data.hasExtra("stress")) {
33 | startActivity(ResultActivity.startIntent(this, data.getExtras()));
34 | finish();
35 | }
36 | }
37 | }
38 |
--------------------------------------------------------------------------------
/app/src/main/java/com/welltory/dds/android/ResultActivity.java:
--------------------------------------------------------------------------------
1 | package com.welltory.dds.android;
2 |
3 | import android.content.Context;
4 | import android.content.Intent;
5 | import android.graphics.drawable.GradientDrawable;
6 | import android.net.Uri;
7 | import android.os.Bundle;
8 | import android.view.LayoutInflater;
9 | import android.view.View;
10 | import android.view.ViewGroup;
11 | import android.widget.LinearLayout;
12 | import android.widget.TextView;
13 |
14 | import androidx.annotation.Nullable;
15 | import androidx.appcompat.app.AppCompatActivity;
16 | import androidx.core.content.ContextCompat;
17 |
18 | import java.util.ArrayList;
19 | import java.util.Locale;
20 |
21 | /**
22 | * Created: Belozerov Sergei
23 | * Company: Welltory Inc.
24 | * Date: 2019-09-04
25 | */
26 | public class ResultActivity extends AppCompatActivity {
27 | private StressLevel stressLevel = null;
28 | private TextView stressLevelText = null;
29 | private TextView stressLevelPercent = null;
30 | private TextView detailsButton = null;
31 | private LinearLayout extraParamsContainer = null;
32 | private static final String PROD_TOKEN_URL = "https://app.welltory.com/share-measurement?token=%s";
33 | private static final String STAGE_TOKEN_URL = "https://stage-app.welltory.com/share-measurement?token=%s";
34 |
35 | public static final String EXTRA_STRESS = "stress";
36 | public static final String EXTRA_STRESS_LEVEL = "stress_c";
37 | public static final String EXTRA_TOKEN = "token";
38 | public static final String EXTRA_IS_STAGE = "is_stage_server";
39 | public static final String EXTRA_ENERGY = "energy";
40 | public static final String EXTRA_PRODUCTIVITY = "productivity";
41 | public static final String EXTRA_RMSSD = "rmssd";
42 | public static final String EXTRA_SDNN = "sdnn";
43 |
44 | @Override
45 | protected void onCreate(@Nullable Bundle savedInstanceState) {
46 | super.onCreate(savedInstanceState);
47 | setContentView(R.layout.activity_result);
48 | initViews();
49 | initClickListeners();
50 |
51 | parseIntent(getIntent());
52 | }
53 |
54 | @Override
55 | protected void onNewIntent(Intent intent) {
56 | super.onNewIntent(intent);
57 | parseIntent(intent);
58 | }
59 |
60 | private void initClickListeners() {
61 | findViewById(R.id.help).setOnClickListener(new View.OnClickListener() {
62 | @Override
63 | public void onClick(View v) {
64 | Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse("https://support.welltory.com/article/show/68986-how-to-use-your-measurement-results"));
65 | startActivity(intent);
66 | }
67 | });
68 | findViewById(R.id.repeatButton).setOnClickListener(new View.OnClickListener() {
69 | @Override
70 | public void onClick(View v) {
71 | WelltoryMeasurementUtils.startMeasurement(ResultActivity.this);
72 | }
73 | });
74 | }
75 |
76 | private void initViews() {
77 | stressLevel = findViewById(R.id.stressLevel);
78 | stressLevelPercent = findViewById(R.id.stressLevelPercent);
79 | stressLevelText = findViewById(R.id.stressLevelText);
80 | detailsButton = findViewById(R.id.details);
81 | extraParamsContainer = findViewById(R.id.extraParams);
82 | }
83 |
84 | public static Intent startIntent(Context context, Bundle extras) {
85 | Intent intent = new Intent(context, ResultActivity.class);
86 | intent.putExtras(extras);
87 | return intent;
88 | }
89 |
90 | private void parseIntent(Intent intent) {
91 | float stress = intent.getFloatExtra(EXTRA_STRESS, 0);
92 | String level = intent.getStringExtra(EXTRA_STRESS_LEVEL);
93 | final String token = intent.getStringExtra(EXTRA_TOKEN);
94 | if (level == null)
95 | level = "green";
96 | stressLevelPercent.setText(String.format(Locale.getDefault(), "%.0f%%", stress * 100));
97 | GradientDrawable shape = new GradientDrawable();
98 | shape.setShape(GradientDrawable.RECTANGLE);
99 | shape.setCornerRadius(ScreenUtils.dp(this, 10));
100 | String stressText = "Unknown";
101 | switch (level) {
102 | case "green":
103 | stressText = getString(R.string.stressLevelGood);
104 | shape.setColor(ContextCompat.getColor(this, R.color.green));
105 | break;
106 | case "yellow":
107 | stressText = getString(R.string.stressLevelAverage);
108 | shape.setColor(ContextCompat.getColor(this, R.color.yellow));
109 | break;
110 | case "red":
111 | stressText = getString(R.string.stressLevelBad);
112 | shape.setColor(ContextCompat.getColor(this, R.color.red));
113 | break;
114 | case "unknown":
115 | shape.setColor(ContextCompat.getColor(this, R.color.grey_6_40));
116 | break;
117 | }
118 | stressLevelText.setText(stressText);
119 | stressLevelPercent.setBackground(shape);
120 | stressLevel.setStress(stress);
121 |
122 | detailsButton.setOnClickListener(new View.OnClickListener() {
123 | @Override
124 | public void onClick(View v) {
125 | if (token != null) {
126 | boolean isStage = getIntent().getBooleanExtra(EXTRA_IS_STAGE, false);
127 | Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse(String.format(Locale.getDefault(), isStage ? STAGE_TOKEN_URL : PROD_TOKEN_URL, token)));
128 | startActivity(intent);
129 | }
130 | }
131 | });
132 |
133 | addExtraParamsViews(intent);
134 | }
135 |
136 | private void addExtraParamsViews(Intent intent) {
137 | ArrayList extraParams = new ArrayList<>();
138 | extraParams.add(new ExtraParam(getString(R.string.energy),
139 | getString(R.string.percentValue, intent.getFloatExtra(EXTRA_ENERGY, 0) * 100)));
140 | extraParams.add(new ExtraParam(getString(R.string.productivity),
141 | getString(R.string.percentValue, intent.getFloatExtra(EXTRA_PRODUCTIVITY, 0) * 100)));
142 | extraParams.add(new ExtraParam(getString(R.string.rmssd),
143 | getString(R.string.msValue, intent.getFloatExtra(EXTRA_RMSSD, 0))));
144 | extraParams.add(new ExtraParam(getString(R.string.sdnn),
145 | getString(R.string.msValue, intent.getFloatExtra(EXTRA_SDNN, 0))));
146 |
147 | extraParamsContainer.removeAllViews();
148 | for (ExtraParam extraParam : extraParams) {
149 | View view = LayoutInflater.from(this).inflate(R.layout.view_extra_param, extraParamsContainer, false);
150 | LinearLayout.LayoutParams layoutParams = new LinearLayout.LayoutParams(0, ViewGroup.LayoutParams.WRAP_CONTENT);
151 | layoutParams.weight = 1;
152 | ((TextView) view.findViewById(R.id.title)).setText(extraParam.name);
153 | ((TextView) view.findViewById(R.id.value)).setText(extraParam.value);
154 | extraParamsContainer.addView(view, layoutParams);
155 | }
156 | }
157 |
158 | private class ExtraParam {
159 | String name;
160 | String value;
161 |
162 | public ExtraParam(String name, String value) {
163 | this.name = name;
164 | this.value = value;
165 | }
166 | }
167 | }
168 |
--------------------------------------------------------------------------------
/app/src/main/java/com/welltory/dds/android/ScreenUtils.java:
--------------------------------------------------------------------------------
1 | package com.welltory.dds.android;
2 |
3 | import android.content.Context;
4 | import android.util.DisplayMetrics;
5 | import android.util.TypedValue;
6 |
7 | /**
8 | * Created: Belozerov Sergei
9 | * Company: Welltory Inc.
10 | * Date: 2019-09-06
11 | */
12 | public class ScreenUtils {
13 | public static int dp(Context context, float dipValue) {
14 | DisplayMetrics metrics = context.getResources().getDisplayMetrics();
15 | return (int) TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, dipValue, metrics);
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/app/src/main/java/com/welltory/dds/android/StressLevel.java:
--------------------------------------------------------------------------------
1 | package com.welltory.dds.android;
2 |
3 | import android.content.Context;
4 | import android.content.res.TypedArray;
5 | import android.graphics.Bitmap;
6 | import android.graphics.BitmapFactory;
7 | import android.graphics.Canvas;
8 | import android.graphics.Paint;
9 | import android.util.AttributeSet;
10 | import android.view.View;
11 |
12 | import androidx.annotation.Nullable;
13 |
14 | /**
15 | * Created: Belozerov Sergei
16 | * Company: Welltory Inc.
17 | * Date: 2019-09-05
18 | */
19 | public class StressLevel extends View {
20 |
21 | private Bitmap bgBitmap;
22 | private Paint bitmapPaint = new Paint();
23 | private Bitmap arrowBitmap;
24 |
25 | private float angle = 0;
26 |
27 | public void setStress(float stress) {
28 | setAngle(stress * 180f);
29 | }
30 |
31 | public float getAngle() {
32 | return angle;
33 | }
34 |
35 | public void setAngle(float angle) {
36 | this.angle = angle;
37 | }
38 |
39 | public StressLevel(Context context) {
40 | this(context, null);
41 | }
42 |
43 | public StressLevel(Context context, @Nullable AttributeSet attrs) {
44 | this(context, attrs, 0);
45 | }
46 |
47 | public StressLevel(Context context, @Nullable AttributeSet attrs, int defStyleAttr) {
48 | this(context, attrs, defStyleAttr, 0);
49 | }
50 |
51 | public StressLevel(Context context, @Nullable AttributeSet attrs, int defStyleAttr, int defStyleRes) {
52 | super(context, attrs, defStyleAttr, defStyleRes);
53 | if (attrs != null) {
54 | TypedArray typedArray = getContext().obtainStyledAttributes(attrs, R.styleable.StressLevel, 0, 0);
55 | angle = typedArray.getFloat(R.styleable.StressLevel_sl_angle, 0);
56 | typedArray.recycle();
57 | }
58 | bitmapPaint.setAntiAlias(true);
59 | bgBitmap = BitmapFactory.decodeResource(context.getResources(), R.drawable.image_stress_level);
60 | arrowBitmap = BitmapFactory.decodeResource(context.getResources(), R.drawable.image_stress_arrow);
61 | }
62 |
63 | @Override
64 | protected void onDraw(Canvas canvas) {
65 | super.onDraw(canvas);
66 | canvas.drawBitmap(bgBitmap, (getWidth() - bgBitmap.getWidth()) / 2f, getHeight() - bgBitmap.getHeight(), bitmapPaint);
67 | canvas.save();
68 | canvas.rotate(angle, getWidth() / 2, getHeight());
69 | canvas.drawBitmap(arrowBitmap, 0, getHeight() - arrowBitmap.getHeight() / 2f, bitmapPaint);
70 | canvas.restore();
71 | }
72 | }
73 |
--------------------------------------------------------------------------------
/app/src/main/java/com/welltory/dds/android/WelltoryMeasurementUtils.java:
--------------------------------------------------------------------------------
1 | package com.welltory.dds.android;
2 |
3 | import android.app.Activity;
4 | import android.content.Intent;
5 | import android.net.Uri;
6 |
7 | import java.io.UnsupportedEncodingException;
8 | import java.net.URLEncoder;
9 | import java.util.Locale;
10 |
11 | /**
12 | * Created: Belozerov Sergei
13 | * Company: Welltory Inc.
14 | * Date: 2019-09-06
15 | */
16 | public class WelltoryMeasurementUtils {
17 | public static void startMeasurement(Activity activity) {
18 | String callBackActivity = String.format(Locale.getDefault(), "%s/%s",
19 | activity.getPackageName(), activity.getClass().getName());
20 | String params = String.format(Locale.getDefault(),
21 | "source=%s&callback=%s¶m1=test_param1", "DemoApp", callBackActivity);
22 | Intent intent = null;
23 | try {
24 | String encodedParams = URLEncoder.encode(params, "UTF-8");
25 | intent = new Intent(Intent.ACTION_VIEW, Uri.parse("welltory://branch/Measurement/Start/" + encodedParams));
26 | if (intent.resolveActivity(activity.getPackageManager()) == null) {
27 | intent = new Intent(Intent.ACTION_VIEW, Uri.parse("https://play.google.com/store/apps/details?id=com.welltory.client.android&referrer=" + encodedParams));
28 | }
29 | } catch (UnsupportedEncodingException e) {
30 | e.printStackTrace();
31 | }
32 | if (intent != null) {
33 | intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TOP);
34 | activity.startActivity(intent);
35 | }
36 | }
37 | }
38 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable-hdpi/image_start_bg.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/phpblackbox/measure-stress-hrv-android/a0f35d8bcbd46ee7106f5a67665afadf772aaa9d/app/src/main/res/drawable-hdpi/image_start_bg.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-hdpi/image_stress_arrow.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/phpblackbox/measure-stress-hrv-android/a0f35d8bcbd46ee7106f5a67665afadf772aaa9d/app/src/main/res/drawable-hdpi/image_stress_arrow.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-hdpi/image_stress_level.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/phpblackbox/measure-stress-hrv-android/a0f35d8bcbd46ee7106f5a67665afadf772aaa9d/app/src/main/res/drawable-hdpi/image_stress_level.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-mdpi/image_start_bg.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/phpblackbox/measure-stress-hrv-android/a0f35d8bcbd46ee7106f5a67665afadf772aaa9d/app/src/main/res/drawable-mdpi/image_start_bg.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-mdpi/image_stress_arrow.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/phpblackbox/measure-stress-hrv-android/a0f35d8bcbd46ee7106f5a67665afadf772aaa9d/app/src/main/res/drawable-mdpi/image_stress_arrow.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-mdpi/image_stress_level.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/phpblackbox/measure-stress-hrv-android/a0f35d8bcbd46ee7106f5a67665afadf772aaa9d/app/src/main/res/drawable-mdpi/image_stress_level.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-v24/ic_launcher_background.xml:
--------------------------------------------------------------------------------
1 |
7 |
10 |
11 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable-v24/ic_launcher_foreground.xml:
--------------------------------------------------------------------------------
1 |
6 |
8 |
12 |
13 |
14 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable-xhdpi/image_start_bg.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/phpblackbox/measure-stress-hrv-android/a0f35d8bcbd46ee7106f5a67665afadf772aaa9d/app/src/main/res/drawable-xhdpi/image_start_bg.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-xhdpi/image_stress_arrow.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/phpblackbox/measure-stress-hrv-android/a0f35d8bcbd46ee7106f5a67665afadf772aaa9d/app/src/main/res/drawable-xhdpi/image_stress_arrow.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-xhdpi/image_stress_level.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/phpblackbox/measure-stress-hrv-android/a0f35d8bcbd46ee7106f5a67665afadf772aaa9d/app/src/main/res/drawable-xhdpi/image_stress_level.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-xxhdpi/image_start_bg.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/phpblackbox/measure-stress-hrv-android/a0f35d8bcbd46ee7106f5a67665afadf772aaa9d/app/src/main/res/drawable-xxhdpi/image_start_bg.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-xxhdpi/image_stress_arrow.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/phpblackbox/measure-stress-hrv-android/a0f35d8bcbd46ee7106f5a67665afadf772aaa9d/app/src/main/res/drawable-xxhdpi/image_stress_arrow.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-xxhdpi/image_stress_level.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/phpblackbox/measure-stress-hrv-android/a0f35d8bcbd46ee7106f5a67665afadf772aaa9d/app/src/main/res/drawable-xxhdpi/image_stress_level.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-xxxhdpi/image_start_bg.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/phpblackbox/measure-stress-hrv-android/a0f35d8bcbd46ee7106f5a67665afadf772aaa9d/app/src/main/res/drawable-xxxhdpi/image_start_bg.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-xxxhdpi/image_stress_arrow.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/phpblackbox/measure-stress-hrv-android/a0f35d8bcbd46ee7106f5a67665afadf772aaa9d/app/src/main/res/drawable-xxxhdpi/image_stress_arrow.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-xxxhdpi/image_stress_level.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/phpblackbox/measure-stress-hrv-android/a0f35d8bcbd46ee7106f5a67665afadf772aaa9d/app/src/main/res/drawable-xxxhdpi/image_stress_level.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable/bg_result_widget.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/bg_tag.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/button.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_help.xml:
--------------------------------------------------------------------------------
1 |
6 |
10 |
16 |
17 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_launcher_background.xml:
--------------------------------------------------------------------------------
1 |
7 |
10 |
11 |
17 |
18 |
19 |
20 |
21 |
22 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_launcher_foreground.xml:
--------------------------------------------------------------------------------
1 |
6 |
8 |
12 |
13 |
14 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_welltory.xml:
--------------------------------------------------------------------------------
1 |
7 |
10 |
11 |
17 |
18 |
19 |
20 |
21 |
22 |
25 |
27 |
28 |
34 |
35 |
36 |
37 |
38 |
39 |
42 |
45 |
48 |
51 |
55 |
56 |
--------------------------------------------------------------------------------
/app/src/main/res/font/proxima.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
7 |
8 |
12 |
13 |
--------------------------------------------------------------------------------
/app/src/main/res/font/proxima_bold.otf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/phpblackbox/measure-stress-hrv-android/a0f35d8bcbd46ee7106f5a67665afadf772aaa9d/app/src/main/res/font/proxima_bold.otf
--------------------------------------------------------------------------------
/app/src/main/res/font/proxima_reg.otf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/phpblackbox/measure-stress-hrv-android/a0f35d8bcbd46ee7106f5a67665afadf772aaa9d/app/src/main/res/font/proxima_reg.otf
--------------------------------------------------------------------------------
/app/src/main/res/layout/activity_main.xml:
--------------------------------------------------------------------------------
1 |
2 |
9 |
10 |
11 |
26 |
27 |
40 |
41 |
54 |
55 |
69 |
70 |
82 |
83 |
89 |
90 |
91 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/activity_result.xml:
--------------------------------------------------------------------------------
1 |
2 |
8 |
9 |
20 |
21 |
34 |
35 |
49 |
50 |
67 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/view_extra_param.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
18 |
19 |
29 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/view_result.xml:
--------------------------------------------------------------------------------
1 |
2 |
10 |
11 |
29 |
30 |
40 |
41 |
49 |
50 |
61 |
62 |
68 |
69 |
78 |
79 |
91 |
92 |
103 |
104 |
105 |
106 |
113 |
114 |
121 |
122 |
123 |
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-hdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/phpblackbox/measure-stress-hrv-android/a0f35d8bcbd46ee7106f5a67665afadf772aaa9d/app/src/main/res/mipmap-hdpi/ic_launcher.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-hdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/phpblackbox/measure-stress-hrv-android/a0f35d8bcbd46ee7106f5a67665afadf772aaa9d/app/src/main/res/mipmap-hdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-mdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/phpblackbox/measure-stress-hrv-android/a0f35d8bcbd46ee7106f5a67665afadf772aaa9d/app/src/main/res/mipmap-mdpi/ic_launcher.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-mdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/phpblackbox/measure-stress-hrv-android/a0f35d8bcbd46ee7106f5a67665afadf772aaa9d/app/src/main/res/mipmap-mdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/phpblackbox/measure-stress-hrv-android/a0f35d8bcbd46ee7106f5a67665afadf772aaa9d/app/src/main/res/mipmap-xhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/phpblackbox/measure-stress-hrv-android/a0f35d8bcbd46ee7106f5a67665afadf772aaa9d/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/phpblackbox/measure-stress-hrv-android/a0f35d8bcbd46ee7106f5a67665afadf772aaa9d/app/src/main/res/mipmap-xxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/phpblackbox/measure-stress-hrv-android/a0f35d8bcbd46ee7106f5a67665afadf772aaa9d/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/phpblackbox/measure-stress-hrv-android/a0f35d8bcbd46ee7106f5a67665afadf772aaa9d/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/phpblackbox/measure-stress-hrv-android/a0f35d8bcbd46ee7106f5a67665afadf772aaa9d/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/app/src/main/res/values/attrs.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/app/src/main/res/values/colors.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | #37373A
4 | #37373A
5 | #FF0941
6 | #151A22
7 | #3A3F4A
8 | #66C0C3CD
9 | #B3FFFFFF
10 | #fff
11 | #03CB34
12 | #FF003F
13 | #FFBF00
14 |
15 |
--------------------------------------------------------------------------------
/app/src/main/res/values/strings.xml:
--------------------------------------------------------------------------------
1 |
2 | Welltory DDS Demo
3 | Measure now
4 | Press button to start measurement
5 | Track your stress
6 | This new feature allows you to measure your stress levels so you can make informed decisions about how to improve your work performance.
7 | #1 Stress Measurement App
8 | details
9 | Stress
10 | What\'s next?
11 | Chronic stress has negative effects on your health. Your participation helps us to evaluate the scope of the problem. Thanks for using our new feature.
12 | This is good stress
13 | This is average stress
14 | This is bad stress
15 | Energy
16 | Productivity
17 | rMSSD
18 | SDNN
19 | %.0f%%
20 | %.0f ms
21 |
22 |
--------------------------------------------------------------------------------
/app/src/main/res/values/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/build.gradle:
--------------------------------------------------------------------------------
1 | // Top-level build file where you can add configuration options common to all sub-projects/modules.
2 |
3 | buildscript {
4 | repositories {
5 | google()
6 | jcenter()
7 |
8 | }
9 | dependencies {
10 | classpath 'com.android.tools.build:gradle:3.5.4'
11 |
12 | // NOTE: Do not place your application dependencies here; they belong
13 | // in the individual module build.gradle files
14 | }
15 | }
16 |
17 | allprojects {
18 | repositories {
19 | google()
20 | jcenter()
21 |
22 | }
23 | }
24 |
25 | task clean(type: Delete) {
26 | delete rootProject.buildDir
27 | }
28 |
--------------------------------------------------------------------------------
/gradle.properties:
--------------------------------------------------------------------------------
1 | # Project-wide Gradle settings.
2 | # IDE (e.g. Android Studio) users:
3 | # Gradle settings configured through the IDE *will override*
4 | # any settings specified in this file.
5 | # For more details on how to configure your build environment visit
6 | # http://www.gradle.org/docs/current/userguide/build_environment.html
7 | # Specifies the JVM arguments used for the daemon process.
8 | # The setting is particularly useful for tweaking memory settings.
9 | org.gradle.jvmargs=-Xmx1536m
10 | # When configured, Gradle will run in incubating parallel mode.
11 | # This option should only be used with decoupled projects. More details, visit
12 | # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
13 | # org.gradle.parallel=true
14 | # AndroidX package structure to make it clearer which packages are bundled with the
15 | # Android operating system, and which are packaged with your app's APK
16 | # https://developer.android.com/topic/libraries/support-library/androidx-rn
17 | android.useAndroidX=true
18 | # Automatically convert third-party libraries to use AndroidX
19 | android.enableJetifier=true
20 |
21 |
--------------------------------------------------------------------------------
/gradle/wrapper/gradle-wrapper.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/phpblackbox/measure-stress-hrv-android/a0f35d8bcbd46ee7106f5a67665afadf772aaa9d/gradle/wrapper/gradle-wrapper.jar
--------------------------------------------------------------------------------
/gradle/wrapper/gradle-wrapper.properties:
--------------------------------------------------------------------------------
1 | #Mon Sep 02 11:26:41 YEKT 2019
2 | distributionBase=GRADLE_USER_HOME
3 | distributionPath=wrapper/dists
4 | zipStoreBase=GRADLE_USER_HOME
5 | zipStorePath=wrapper/dists
6 | distributionUrl=https\://services.gradle.org/distributions/gradle-5.4.1-all.zip
7 |
--------------------------------------------------------------------------------
/gradlew:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env sh
2 |
3 | ##############################################################################
4 | ##
5 | ## Gradle start up script for UN*X
6 | ##
7 | ##############################################################################
8 |
9 | # Attempt to set APP_HOME
10 | # Resolve links: $0 may be a link
11 | PRG="$0"
12 | # Need this for relative symlinks.
13 | while [ -h "$PRG" ] ; do
14 | ls=`ls -ld "$PRG"`
15 | link=`expr "$ls" : '.*-> \(.*\)$'`
16 | if expr "$link" : '/.*' > /dev/null; then
17 | PRG="$link"
18 | else
19 | PRG=`dirname "$PRG"`"/$link"
20 | fi
21 | done
22 | SAVED="`pwd`"
23 | cd "`dirname \"$PRG\"`/" >/dev/null
24 | APP_HOME="`pwd -P`"
25 | cd "$SAVED" >/dev/null
26 |
27 | APP_NAME="Gradle"
28 | APP_BASE_NAME=`basename "$0"`
29 |
30 | # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
31 | DEFAULT_JVM_OPTS=""
32 |
33 | # Use the maximum available, or set MAX_FD != -1 to use that value.
34 | MAX_FD="maximum"
35 |
36 | warn () {
37 | echo "$*"
38 | }
39 |
40 | die () {
41 | echo
42 | echo "$*"
43 | echo
44 | exit 1
45 | }
46 |
47 | # OS specific support (must be 'true' or 'false').
48 | cygwin=false
49 | msys=false
50 | darwin=false
51 | nonstop=false
52 | case "`uname`" in
53 | CYGWIN* )
54 | cygwin=true
55 | ;;
56 | Darwin* )
57 | darwin=true
58 | ;;
59 | MINGW* )
60 | msys=true
61 | ;;
62 | NONSTOP* )
63 | nonstop=true
64 | ;;
65 | esac
66 |
67 | CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
68 |
69 | # Determine the Java command to use to start the JVM.
70 | if [ -n "$JAVA_HOME" ] ; then
71 | if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
72 | # IBM's JDK on AIX uses strange locations for the executables
73 | JAVACMD="$JAVA_HOME/jre/sh/java"
74 | else
75 | JAVACMD="$JAVA_HOME/bin/java"
76 | fi
77 | if [ ! -x "$JAVACMD" ] ; then
78 | die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
79 |
80 | Please set the JAVA_HOME variable in your environment to match the
81 | location of your Java installation."
82 | fi
83 | else
84 | JAVACMD="java"
85 | which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
86 |
87 | Please set the JAVA_HOME variable in your environment to match the
88 | location of your Java installation."
89 | fi
90 |
91 | # Increase the maximum file descriptors if we can.
92 | if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then
93 | MAX_FD_LIMIT=`ulimit -H -n`
94 | if [ $? -eq 0 ] ; then
95 | if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
96 | MAX_FD="$MAX_FD_LIMIT"
97 | fi
98 | ulimit -n $MAX_FD
99 | if [ $? -ne 0 ] ; then
100 | warn "Could not set maximum file descriptor limit: $MAX_FD"
101 | fi
102 | else
103 | warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
104 | fi
105 | fi
106 |
107 | # For Darwin, add options to specify how the application appears in the dock
108 | if $darwin; then
109 | GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
110 | fi
111 |
112 | # For Cygwin, switch paths to Windows format before running java
113 | if $cygwin ; then
114 | APP_HOME=`cygpath --path --mixed "$APP_HOME"`
115 | CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
116 | JAVACMD=`cygpath --unix "$JAVACMD"`
117 |
118 | # We build the pattern for arguments to be converted via cygpath
119 | ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
120 | SEP=""
121 | for dir in $ROOTDIRSRAW ; do
122 | ROOTDIRS="$ROOTDIRS$SEP$dir"
123 | SEP="|"
124 | done
125 | OURCYGPATTERN="(^($ROOTDIRS))"
126 | # Add a user-defined pattern to the cygpath arguments
127 | if [ "$GRADLE_CYGPATTERN" != "" ] ; then
128 | OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
129 | fi
130 | # Now convert the arguments - kludge to limit ourselves to /bin/sh
131 | i=0
132 | for arg in "$@" ; do
133 | CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
134 | CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option
135 |
136 | if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition
137 | eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
138 | else
139 | eval `echo args$i`="\"$arg\""
140 | fi
141 | i=$((i+1))
142 | done
143 | case $i in
144 | (0) set -- ;;
145 | (1) set -- "$args0" ;;
146 | (2) set -- "$args0" "$args1" ;;
147 | (3) set -- "$args0" "$args1" "$args2" ;;
148 | (4) set -- "$args0" "$args1" "$args2" "$args3" ;;
149 | (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
150 | (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
151 | (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
152 | (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
153 | (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
154 | esac
155 | fi
156 |
157 | # Escape application args
158 | save () {
159 | for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done
160 | echo " "
161 | }
162 | APP_ARGS=$(save "$@")
163 |
164 | # Collect all arguments for the java command, following the shell quoting and substitution rules
165 | eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS"
166 |
167 | # by default we should be in the correct project dir, but when run from Finder on Mac, the cwd is wrong
168 | if [ "$(uname)" = "Darwin" ] && [ "$HOME" = "$PWD" ]; then
169 | cd "$(dirname "$0")"
170 | fi
171 |
172 | exec "$JAVACMD" "$@"
173 |
--------------------------------------------------------------------------------
/gradlew.bat:
--------------------------------------------------------------------------------
1 | @if "%DEBUG%" == "" @echo off
2 | @rem ##########################################################################
3 | @rem
4 | @rem Gradle startup script for Windows
5 | @rem
6 | @rem ##########################################################################
7 |
8 | @rem Set local scope for the variables with windows NT shell
9 | if "%OS%"=="Windows_NT" setlocal
10 |
11 | set DIRNAME=%~dp0
12 | if "%DIRNAME%" == "" set DIRNAME=.
13 | set APP_BASE_NAME=%~n0
14 | set APP_HOME=%DIRNAME%
15 |
16 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
17 | set DEFAULT_JVM_OPTS=
18 |
19 | @rem Find java.exe
20 | if defined JAVA_HOME goto findJavaFromJavaHome
21 |
22 | set JAVA_EXE=java.exe
23 | %JAVA_EXE% -version >NUL 2>&1
24 | if "%ERRORLEVEL%" == "0" goto init
25 |
26 | echo.
27 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
28 | echo.
29 | echo Please set the JAVA_HOME variable in your environment to match the
30 | echo location of your Java installation.
31 |
32 | goto fail
33 |
34 | :findJavaFromJavaHome
35 | set JAVA_HOME=%JAVA_HOME:"=%
36 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe
37 |
38 | if exist "%JAVA_EXE%" goto init
39 |
40 | echo.
41 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
42 | echo.
43 | echo Please set the JAVA_HOME variable in your environment to match the
44 | echo location of your Java installation.
45 |
46 | goto fail
47 |
48 | :init
49 | @rem Get command-line arguments, handling Windows variants
50 |
51 | if not "%OS%" == "Windows_NT" goto win9xME_args
52 |
53 | :win9xME_args
54 | @rem Slurp the command line arguments.
55 | set CMD_LINE_ARGS=
56 | set _SKIP=2
57 |
58 | :win9xME_args_slurp
59 | if "x%~1" == "x" goto execute
60 |
61 | set CMD_LINE_ARGS=%*
62 |
63 | :execute
64 | @rem Setup the command line
65 |
66 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
67 |
68 | @rem Execute Gradle
69 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
70 |
71 | :end
72 | @rem End local scope for the variables with windows NT shell
73 | if "%ERRORLEVEL%"=="0" goto mainEnd
74 |
75 | :fail
76 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
77 | rem the _cmd.exe /c_ return code!
78 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
79 | exit /b 1
80 |
81 | :mainEnd
82 | if "%OS%"=="Windows_NT" endlocal
83 |
84 | :omega
85 |
--------------------------------------------------------------------------------
/screens/Frame.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/phpblackbox/measure-stress-hrv-android/a0f35d8bcbd46ee7106f5a67665afadf772aaa9d/screens/Frame.jpg
--------------------------------------------------------------------------------
/screens/screen_1.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/phpblackbox/measure-stress-hrv-android/a0f35d8bcbd46ee7106f5a67665afadf772aaa9d/screens/screen_1.jpg
--------------------------------------------------------------------------------
/screens/screen_2.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/phpblackbox/measure-stress-hrv-android/a0f35d8bcbd46ee7106f5a67665afadf772aaa9d/screens/screen_2.jpg
--------------------------------------------------------------------------------
/screens/screen_3.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/phpblackbox/measure-stress-hrv-android/a0f35d8bcbd46ee7106f5a67665afadf772aaa9d/screens/screen_3.jpg
--------------------------------------------------------------------------------
/screens/screen_4.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/phpblackbox/measure-stress-hrv-android/a0f35d8bcbd46ee7106f5a67665afadf772aaa9d/screens/screen_4.jpg
--------------------------------------------------------------------------------
/settings.gradle:
--------------------------------------------------------------------------------
1 | include ':app'
2 | rootProject.name='Welltory DDS Demo'
3 |
--------------------------------------------------------------------------------