Installing the SDK

This guide will help you setup the Android Consumer SDK in your application for live tracking. The Consumer SDK has a extensible map view and methods to track task statuses.

If you're looking for an example integration, use the example-android application.

[warning] Requirements

The SDK is compatible with Android 4.1 (API level 16) and above.

Install the dependency

In your app's build.gradle file, define the repositories and dependencies as shown.

[info] build.gradle files

Your project will have two gradle files: one for the app module, and one for the project. Edit the app module file to install the SDK.

Once configured, run a gradle sync to import the SDK and its dependencies to your project.

repositories {
    maven { url "http://hypertrack-android-sdk.s3-website-us-west-2.amazonaws.com/" }
}

dependencies {
    compile("io.hypertrack:consumer:1.5.13:release@aar") {
        transitive = true;
    }
}

Proguard Rules

If you are using Proguard in your project add the following lines to your proguard configuration file (proguard-rules.pro):

  -keep class io.hypertrack.lib.** { *; }
  -dontwarn io.hypertrack.lib.**

Configure the API key

To configure the SDK, set the publishable key. Also, initialize the SDK in the onCreate method of your Application class, so that it will be configured for the entire lifecycle of your app.

@Override
protected void onCreate(Bundle savedInstanceState) {
  super.onCreate(savedInstanceState);
  setContentView(R.layout.activity_main);
  ...

  HyperTrack.setPublishableApiKey("YOUR_PUBLISHABLE_KEY", getApplicationContext());
  HTConsumerClient.initHTConsumerClient(getApplicationContext());
}

Was this helpful? Yes, thanks! Not really

results matching ""

    No results matching ""