Android

1
Last updated 13 days ago

Get started by plugging in the SDK in your Android app

The HyperTrack SDK for Android is ~300 KBs in size and consumes 5% battery per day on average.

Sign up here to get your keys, and the follow the steps below to add the SDK.

Step 1: Add SDK

Add the SDK to your build.gradle.

// Import the SDK within your repositories block
repositories {
maven { url 'http://hypertrack-core-android.s3-website-us-east-1.amazonaws.com/' }
...
}
//Add HyperTrack as a dependency
dependencies {
compile("com.hypertrack.core:android:0.8.12@aar"){
transitive = true;
}
...
}

Step 2: Get permissions

Get location permission from the app user on the device. Also check if the user has turned on location services on the device.

HyperTrackCore.requestLocationPermissions(this, new LocationPermissionCallback() {
@Override
public void onLocationPermissionGranted() {
// Handle location permission granted
}
@Override
public void onLocationPermissionDenied() {
// Handle location permission denied
}
});

Step 3: Initialize SDK

Initialize the SDK with your publishable key.

//Initialize the SDK within the onCreate method of your Application subclass
public void onCreate() {
super.onCreate();
HyperTrackCore.initialize(this, PUBLISHABLE_KEY);
...
}

Step 4: Run your app

You are all set. It’s now time to compile and run your app.

Congratulations on configuring your app with the SDK