-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
VIT-7196: Move to Sonatype OSS registry (#155)
- Loading branch information
Showing
12 changed files
with
862 additions
and
124 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
name: Android Release | ||
|
||
on: | ||
release: | ||
types: [released, prereleased] | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- name: set up JDK 17 | ||
uses: actions/setup-java@v3 | ||
with: | ||
java-version: '17' | ||
distribution: 'temurin' | ||
cache: gradle | ||
|
||
- name: Grant execute permission for gradlew | ||
run: chmod +x gradlew | ||
|
||
- name: Publish | ||
run: ./gradlew publish | ||
env: | ||
USERNAME: ${{ github.actor }} | ||
TOKEN: ${{ github.token }} |
This file was deleted.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,130 +1,33 @@ | ||
# vital_android | ||
# vital-android | ||
|
||
## Introduction | ||
The official Swift Library for Vital API, HealthKit and Devices | ||
|
||
You can find detailed documentation at [`https://docs.tryvital.io/`]. | ||
## Install | ||
|
||
The Vital SDK is split into three main components: `VitalClient`, `VitalHealthConnect` | ||
and `VitalDevices`. | ||
Add the vital-ios package to your Package.swift. | ||
|
||
- `VitalClient` holds common components to both `VitalHealthConnect` and `VitalDevices`. Among other | ||
things, it has the network layer that allows us to send data from a device to a server. | ||
- `VitalHealthConnect` is an abstraction over Health Connect | ||
- `VitalDevices` is an abstraction over a set of Bluetooth devices. | ||
|
||
## Installation | ||
|
||
You can install the Vital SDK by adding the followings to your `build.gradle` file: | ||
|
||
```groovy | ||
repositories { | ||
... | ||
maven { url 'https://jitpack.io' } | ||
} | ||
``` | ||
|
||
```groovy | ||
implementation 'com.github.tryVital.vital-android:VitalClient:$vital_version' | ||
implementation 'com.github.tryVital.vital-android:VitalHealthConnect:$vital_version' | ||
implementation 'com.github.tryVital.vital-android:VitalDevices:$vital_version' | ||
``` | ||
|
||
Replace `$vital_version` with the latest version of the SDK. You only need to add the dependencies | ||
for the components you want to use. | ||
|
||
The min version of the SDK is `21` for VitalClient but for VitalHealthConnect and VitalDevices it is | ||
`26`. | ||
|
||
### VitalClient installation | ||
|
||
You have no additional steps to take to use VitalClient. | ||
|
||
### VitalHealthConnect installation | ||
|
||
The sdk compiles on min version `26` but to get data out of the underlying Health Connect SDK you | ||
need to be on `28` or higher. | ||
|
||
### VitalDevices installation | ||
|
||
Vital Devices uses bluetooth and it requires different permissions based on your apps min version. | ||
Here is an example of a `AndroidManifest.xml` file that uses Vital Devices: | ||
|
||
```xml | ||
<uses-permission android:name="android.permission.BLUETOOTH_SCAN" android:usesPermissionFlags="neverForLocation"/> | ||
<uses-permission android:name="android.permission.BLUETOOTH_CONNECT"/> | ||
|
||
<!-- Request legacy Bluetooth permissions on older devices. --> | ||
<uses-permission android:name="android.permission.BLUETOOTH" android:maxSdkVersion="30"/> | ||
<uses-permission android:name="android.permission.BLUETOOTH_ADMIN" android:maxSdkVersion="30"/> | ||
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" android:maxSdkVersion="30"/> | ||
``` | ||
|
||
## Usage | ||
|
||
### VitalClient | ||
|
||
First you need to get an instance of `VitalClient`: | ||
|
||
```kotlin | ||
val client = VitalClient( | ||
context = this, | ||
region = Region.EU, | ||
environment = Environment.Sandbox, | ||
apiKey = "sk_eu_S5LdX..." //your key from the dashboard | ||
) | ||
``` | ||
|
||
Now you can start using the client to send and receive data from the server. | ||
|
||
You can read about the available methods in | ||
the [docs](https://docs.tryvital.io/api-reference/user/create-user). | ||
|
||
### VitalHealthConnect | ||
|
||
Coming soon. | ||
|
||
### VitalDevices | ||
|
||
To interact with Vital Devices sdk you need to get an instance of the `VitalDeviceManager`: | ||
|
||
```kotlin | ||
val deviceManager = VitalDeviceManager.create(this) | ||
``` | ||
|
||
Next you have to scan for one of the supported devices. You can find the list of supported devices | ||
by calling `VitalDeviceManagerBrands.devices`. | ||
|
||
You can search now. | ||
|
||
```kotlin | ||
vitalDeviceManager.search(deviceModel).collect { scannedDevice -> | ||
// scannedDevice is the device that was found of the type deviceModel | ||
} | ||
``` | ||
|
||
Depending on the type of device you are connecting to, you will have to call different methods to | ||
connect to it. | ||
|
||
#### Blood pressure monitor | ||
|
||
```kotlin | ||
vitalDeviceManager.bloodPressure(context, scannedDevice) | ||
.collect { bloodPressureSample -> | ||
// bloodPressureSample is the sample that was received from the device | ||
} | ||
```swift | ||
.package(url: "https://github.com/tryvital/vital-ios", from: "1.2.2"), | ||
``` | ||
|
||
#### Glucose meter | ||
Then add the Vital iOS library products you need to your app and/or library targets: | ||
|
||
```kotlin | ||
vitalDeviceManager.glucoseMeter(context, scannedDevice) | ||
.collect { glucoseSample -> | ||
// glucoseSample is the sample that was received from the device | ||
} | ||
```swift | ||
.target(name: "AppTarget", dependencies: [ | ||
.product(name: "VitalCore", package: "vital-ios"), | ||
.product(name: "VitalDevices", package: "vital-ios"), | ||
.product(name: "VitalHealthKit", package: "vital-ios"), | ||
]), | ||
``` | ||
|
||
After you have received samples depending on the type of device you might need to star scanning | ||
again to receive the next set of samples. | ||
## Documentation | ||
|
||
* [Installation](https://docs.tryvital.io/wearables/sdks/installation) | ||
* [Authentication](https://docs.tryvital.io/wearables/sdks/authentication) | ||
* [Core SDK](https://docs.tryvital.io/wearables/sdks/vital-core) | ||
* [Health SDK](https://docs.tryvital.io/wearables/sdks/vital-health) | ||
* [Devices SDK](https://docs.tryvital.io/wearables/sdks/vital-devices) | ||
|
||
## License | ||
|
||
vital-ios is available under the AGPLv3 license. See the LICENSE file for more info. VitalDevices is under the `Adept Labs Enterprise Edition (EE) license (the “EE License”)`. Please refer to its license inside its folder. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
The Adept Labs Enterprise Edition (EE) license (the “EE License”) | ||
Copyright (c) 2024 Adept Labs, Inc | ||
|
||
With regard to the Adept Labs Software: | ||
|
||
This software and associated documentation files (the "Software") may only be | ||
used in production, if you (and any entity that you represent) have agreed to, | ||
and are in compliance with, the Adept Labs Terms available | ||
at https://tryvital.io/terms (the “EE Terms”), or other agreements governing | ||
the use of the Software, as mutually agreed by you and Adept Labs, Inc ("Adept Labs"), | ||
and otherwise have a valid Adept Labs Enterprise Edition subscription ("EE Subscription") | ||
for the correct number of hosts as defined in the EE Terms ("Hosts"). Subject to the foregoing sentence, | ||
you are free to modify this Software and publish patches to the Software. You agree | ||
that Adept Labs and/or its licensors (as applicable) retain all right, title and interest in | ||
and to all such modifications and/or patches, and all such modifications and/or | ||
patches may only be used, copied, modified, displayed, distributed, or otherwise | ||
exploited with a valid EE Subscription for the correct number of hosts. | ||
Notwithstanding the foregoing, you may copy and modify the Software for development | ||
and testing purposes, without requiring a subscription. You agree that Adept Labs and/or | ||
its licensors (as applicable) retain all right, title and interest in and to all such | ||
modifications. You are not granted any other rights beyond what is expressly stated herein. | ||
Subject to the foregoing, it is forbidden to copy, merge, publish, distribute, sublicense, | ||
and/or sell the Software. | ||
|
||
This EE License applies only to the part of this Software that is not distributed under | ||
the AGPLv3 license. Any part of this Software distributed under the AGPLv3 license or which | ||
is served client-side as an image, font, cascading stylesheet (CSS), file which produces | ||
or is compiled, arranged, augmented, or combined into client-side JavaScript, in whole or | ||
in part, is copyrighted under the AGPLv3 license. The full text of this EE License 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. | ||
|
||
For all third party components incorporated into the Adept Labs Software, those | ||
components are licensed under the original license provided by the owner of the | ||
applicable component. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.