Skip to content

Commit 3a1902d

Browse files
committed
health v2.0.0
1 parent 72387fa commit 3a1902d

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

66 files changed

+725
-325
lines changed

docs/health/_includes/add-apm-appdescriptor.mdx

Lines changed: 34 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,37 @@
11

2+
### Android Gradle Version
3+
4+
We have updated the required gradle version used to build your application to be higher than the default AIR currently uses (April 2025).
5+
6+
To specify a higher version add the following to your android node in your application descriptor:
7+
8+
```xml
9+
<android>
10+
<gradleVersion>8.9</gradleVersion>
11+
<androidGradlePluginVersion>8.7.3</androidGradlePluginVersion>
12+
13+
...
14+
</android>
15+
```
16+
17+
If you don't do this you will see the following error when building your application:
18+
19+
```
20+
Unexpected failure: Unable to run java: com.adobe.air.ADTException: gradle tool failed:
21+
FAILURE: Build failed with an exception.
22+
23+
...
24+
25+
> BUG! exception in phase 'semantic analysis' in source unit '_BuildScript_' Unsupported class file major version 65
26+
```
27+
28+
:::note
29+
June 2025: This is not currently automatically handled by `apm` so you will need to add this manually to your application descriptor.
30+
31+
We are working on an update to handle this.
32+
:::
33+
34+
235
### Add Android Permissions
336

437
You will need to add the Android permissions to your android manifest for the health data you require access to.
@@ -17,7 +50,7 @@ for example, to read and write the step data you need the following permissions:
1750
<?xml version="1.0" encoding="utf-8"?>
1851
<manifest xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools">
1952

20-
<uses-sdk android:minSdkVersion="26" android:targetSdkVersion="33" />
53+
<uses-sdk android:minSdkVersion="26" android:targetSdkVersion="34" />
2154

2255
<!-- Health Connect Permissions -->
2356
<uses-permission android:name="android.permission.health.READ_STEPS"/>

docs/health/_includes/add-apm.mdx

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,3 +47,17 @@ We suggest you use the locations directly in your builds rather than copying the
4747
apm project config set com.distriqt.Health
4848
```
4949

50+
51+
#### Google Fitness
52+
53+
If you are using Google Fitness, you will need to install the `com.distriqt.Health-Fitness` variant of the extension. This will ensure that the required dependencies for Google Fitness are installed.
54+
55+
The default `com.distriqt.Health` variant does not include the Google Fitness dependencies.
56+
57+
```
58+
apm install com.distriqt.Health-Fitness
59+
```
60+
61+
:::caution
62+
You must only install one of the variants, either `com.distriqt.Health` or `com.distriqt.Health-Fitness`, not both.
63+
:::

docs/health/_includes/add-manual-appdescriptor.mdx

Lines changed: 65 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,15 @@ The following should be added to your `extensions` node in your application desc
1010
<extensionID>androidx.appcompat</extensionID>
1111
<extensionID>androidx.core</extensionID>
1212
<extensionID>androidx.emoji2</extensionID>
13-
<extensionID>androidx.healthconnect</extensionID>
1413
<extensionID>androidx.vectordrawable</extensionID>
1514
<extensionID>com.google.guava</extensionID>
1615
<extensionID>com.jetbrains.kotlin</extensionID>
16+
17+
<!-- If you are using Health Connect, you will need this extension -->
18+
<extensionID>androidx.healthconnect</extensionID>
19+
20+
<!-- If you are using Google Fitness, you will need this extension -->
21+
<extensionID>com.distriqt.playservices.Fitness</extensionID>
1722
</extensions>
1823
```
1924

@@ -31,7 +36,7 @@ The following additions are for the `InfoAdditions` node of the iPhone section i
3136
<InfoAdditions><![CDATA[
3237
3338
<key>MinimumOSVersion</key>
34-
<string>11.0</string>
39+
<string>12.0</string>
3540
3641
<key>UIRequiredDeviceCapabilities</key>
3742
<array>
@@ -83,41 +88,75 @@ Ensure you replace:
8388
<manifest android:installLocation="auto">
8489
<uses-permission android:name="android.permission.INTERNET"/>
8590

86-
<uses-sdk android:minSdkVersion="26" android:targetSdkVersion="33"/>
91+
<uses-sdk android:minSdkVersion="26" android:targetSdkVersion="34"/>
8792

8893
<queries>
94+
<package android:name="com.google.android.apps.fitness"/>
8995
<package android:name="com.google.android.apps.healthdata"/>
9096
</queries>
9197

92-
<permission android:name="air.com.distriqt.test.DYNAMIC_RECEIVER_NOT_EXPORTED_PERMISSION" android:protectionLevel="signature"/>
93-
<uses-permission android:name="air.com.distriqt.test.DYNAMIC_RECEIVER_NOT_EXPORTED_PERMISSION"/>
94-
95-
<application android:appComponentFactory="androidx.core.app.CoreComponentFactory">
96-
97-
98-
<service android:name="androidx.health.platform.client.impl.sdkservice.HealthDataSdkService" android:enabled="true" android:exported="true">
99-
<intent-filter>
100-
<action android:name="androidx.health.platform.client.ACTION_BIND_SDK_SERVICE"/>
101-
</intent-filter>
102-
</service>
103-
<activity android:name="com.distriqt.extension.health.AuthorisationActivity" android:enabled="true" android:exported="true" android:theme="@style/Theme.AppCompat.Light"/>
104-
<activity android:name="com.distriqt.extension.health.PermissionsRationaleActivity" android:enabled="true" android:exported="true" android:theme="@style/Theme.AppCompat.Light">
105-
<intent-filter>
106-
<action android:name="androidx.health.ACTION_SHOW_PERMISSIONS_RATIONALE"/>
107-
</intent-filter>
108-
</activity>
109-
110-
111-
<provider android:name="androidx.startup.InitializationProvider" android:authorities="air.com.distriqt.test.androidx-startup" android:exported="false">
112-
<meta-data android:name="androidx.lifecycle.ProcessLifecycleInitializer" android:value="androidx.startup"/>
113-
<meta-data android:name="androidx.emoji2.text.EmojiCompatInitializer" android:value="androidx.startup"/>
114-
</provider>
98+
<application>
99+
100+
<activity
101+
android:name="com.distriqt.extension.health.PermissionsRationaleActivity"
102+
android:exported="true"
103+
android:enabled="true">
104+
<intent-filter>
105+
<action android:name="androidx.health.ACTION_SHOW_PERMISSIONS_RATIONALE" />
106+
</intent-filter>
107+
</activity>
108+
109+
<activity-alias
110+
android:name="ViewPermissionUsageActivity"
111+
android:exported="true"
112+
android:targetActivity="com.distriqt.extension.health.PermissionsRationaleActivity"
113+
android:permission="android.permission.START_VIEW_PERMISSION_USAGE">
114+
<intent-filter>
115+
<action android:name="android.intent.action.VIEW_PERMISSION_USAGE" />
116+
<category android:name="android.intent.category.HEALTH_PERMISSIONS" />
117+
</intent-filter>
118+
</activity-alias>
119+
115120
<activity android:name="com.distriqt.core.auth.AuthorisationActivity" android:exported="false" android:theme="@android:style/Theme.Translucent.NoTitleBar"/>
116121
</application>
117122
</manifest>
118123
```
119124

120125

126+
### Android Gradle Version
127+
128+
We have updated the required gradle version used to build your application to be higher than the default AIR currently uses (April 2025).
129+
130+
To specify a higher version add the following to your android node in your application descriptor:
131+
132+
```xml
133+
<android>
134+
<gradleVersion>8.9</gradleVersion>
135+
<androidGradlePluginVersion>8.7.3</androidGradlePluginVersion>
136+
137+
...
138+
</android>
139+
```
140+
141+
If you don't do this you will see the following error when building your application:
142+
143+
```
144+
Unexpected failure: Unable to run java: com.adobe.air.ADTException: gradle tool failed:
145+
FAILURE: Build failed with an exception.
146+
147+
...
148+
149+
> BUG! exception in phase 'semantic analysis' in source unit '_BuildScript_' Unsupported class file major version 65
150+
```
151+
152+
:::note
153+
June 2025: This is not currently automatically handled by `apm` so you will need to add this manually to your application descriptor.
154+
155+
We are working on an update to handle this.
156+
:::
157+
158+
159+
121160
### Permissions
122161

123162
In addition to the above you will need to add the permissions for the health data you require access to.
Lines changed: 29 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -5,17 +5,21 @@ sidebar_label: Unity
55

66
First step is always to add the plugin to your development environment.
77

8+
## Add the Plugin
89

9-
## Asset Store
10+
### Asset Store
1011

1112
Open the Asset Store in your browser and add the plugin to your assets.
1213

13-
Open the Package Manager (Window > Package Manager) in the Unity Editor and select the "My Assets" section. Select the plugin, and click Import in the bottom right.
14+
Open the Package Manager (`Window / Package Manager`) in the Unity Editor and select the *"My Assets"* section.
1415

16+
Select the plugin, and click *Import* in the bottom right.
1517

16-
## Manual Installation
1718

18-
In unity you import the package by selecting `Assets / Import Package / Custom Package ...` and then browsing to the unity plugin package file: `com.distriqt.Health.unitypackage`.
19+
### Manual Installation
20+
21+
In unity you import a custom package by selecting `Assets / Import Package / Custom Package...`
22+
and then browsing to the unity plugin package file: `com.distriqt.Health.unitypackage`.
1923

2024
![](images/unity-import-package.png)
2125

@@ -27,20 +31,23 @@ You can manually download the extension from our repository:
2731

2832
## Import the Plugin
2933

30-
31-
This will present the import dialog and display all the files for the plugin, make sure all the files are selected.
34+
This will present the import dialog and display all the files for the plugin,
35+
make sure all the files are selected and click **Import**.
3236

3337
The plugin will be added to your project and you can now use the plugins functionality in your application.
3438

3539

3640

41+
## Android Dependencies
3742

38-
## Resolve Android Dependencies
39-
40-
This plugin depends on some common Android libraries, particularly the Google Play Core Library, which enables in-app reviews.
43+
This plugin depends on some common Android libraries, which are defined within the plugin.
4144

4245
You can get these dependencies using one of the following methods.
4346

47+
:::note
48+
Make sure you select the Android platform in the build profiles / settings before you do this.
49+
:::
50+
4451

4552
### Unity Jar Resolver
4653

@@ -49,14 +56,13 @@ This is the suggested method.
4956
Use the *Unity Jar Resolver* plugin to download and manage the Android dependencies.
5057

5158

52-
5359
#### Importing
5460

5561
> If you already use the *Unity Jar Resolver* in your project you can skip this step.
5662
5763
- Download the latest version of the [*Unity Jar Resolver*](https://github.com/googlesamples/unity-jar-resolver/releases)
5864
- Import the plugin by selecting `Assets / Import Package / Custom Package ...` and locate the plugin you downloaded. The plugin will be in the zip named: `external-dependency-manager-latest.unitypackage`
59-
- In the *Import Unity Package* window, click Import
65+
- In the *Import Unity Package* window, click **Import**
6066

6167

6268
#### Resolving
@@ -73,21 +79,29 @@ More information on the *Unity Jar Resolver* can be found [here](https://github.
7379

7480

7581

76-
### Custom Gradle Health
82+
### Custom Gradle Template
7783

7884
Unity's in-built gradle build support and exporting to android studio does not support per plugin gradle script. Therefore, this plugin cannot add the dependencies by itself.
7985

80-
The `mainHealth.gradle` is generated when you enable the **Custom Gradle Health** property on the Player window.
86+
The `mainTemplate.gradle` is generated when you enable the **Custom Gradle Template** property on the Player window.
8187

8288
The `build.gradle` exists in generated Gradle project when you enable the **Export Project** property on the Player window and Build the project.
8389

84-
Update the `dependencies` section in your `mainHealth.gradle` or `build.gradle` as below:
90+
Update the `dependencies` section in your `mainTemplate.gradle` or `build.gradle` as below:
8591

8692
```
8793
dependencies {
8894
compile fileTree(dir: 'libs', include: ['*.jar'])
8995
90-
implementation 'com.google.android.play:core:1.9.1'
96+
implementation 'androidx.appcompat:appcompat:1.6.1'
97+
implementation 'androidx.activity:activity:1.7.2'
98+
implementation 'com.google.guava:guava:31.0.1-android'
99+
100+
implementation "org.jetbrains.kotlinx:kotlinx-coroutines-android:1.6.4"
101+
implementation "org.jetbrains.kotlinx:kotlinx-coroutines-core:1.6.4"
102+
implementation "org.jetbrains.kotlinx:kotlinx-coroutines-guava:1.6.4"
103+
104+
implementation 'androidx.health.connect:connect-client:1.1.0-alpha11'
91105
}
92106
```
93107

docs/health/authorisation.md

Lines changed: 0 additions & 82 deletions
This file was deleted.

0 commit comments

Comments
 (0)