Current Android(Kotlin) SDK Version: 4.2.62

Requirements

Android 9.0+ (Level 28, P, Pie)

Setup Guide

To add the SDK to your project, you have to add the following to your project’s build.gradle file in the repositories block.

allprojects {
    repositories {
        // Other repositories
        maven {
            url 'https://gitlab.com/api/v4/projects/43396247/packages/maven'
        }
    }
}

After that, add the following to your app’s build.gradle file in the dependencies block.

dependencies {
    // Other dependencies
    implementation "com.spikeapi.sdk:spike-sdk:4.2.62"
}

Android permissions

Include the necessary health permissions in your AndroidManifest.xml to fully leverage the Spike SDK and access data from apps integrated with Health Connect. Please refer to this guide for details on the required permissions.

Note: Only request permissions essential to your app’s functionality. Requesting unused permissions may lead to Play Store rejections.

Add an intent filter to your activity definition so that you can request the permissions at runtime.

<intent-filter>
    <action android:name="androidx.health.ACTION_SHOW_PERMISSIONS_RATIONALE" />
</intent-filter>

To handle Android 14 you also need to add activity-alias to your AndroidManifest.xml It is just a wrapper for the activity that requests permissions so no real activity is necessary.

<activity-alias
    android:name="ViewPermissionUsageActivity"
    android:exported="true"
    android:targetActivity=".MainActivity"
    android:permission="android.permission.START_VIEW_PERMISSION_USAGE">
    <intent-filter>
        <action android:name="android.intent.action.VIEW_PERMISSION_USAGE" />
        <category android:name="android.intent.category.HEALTH_PERMISSIONS" />
    </intent-filter>
</activity-alias>