How to Install the Android SDK

The following steps describe how to setup and initialize the Android SDK.

Setup

  1. First, download the latest version TigerConnect Android SDK. Note that the SDK itself is not open source; please contact TigerConnect to get access to the SDK.

  2. In your project's base directory, create a folder called ttandroid and place the ttandroid.aar file inside.

  3. Then add a build.gradle file with:

    configurations.create("default")
    artifacts.add("default", file('ttandroid-4.0.0.aar'))
  4. Your directory structure should then look like the following:

    build.gradle
    settings.gradle
    ...
    YOUR_APP/
    build.gradle
    src/
    ...
    ttandroid/
    ttandroid.aar
    build.gradle
  5. Next, add the :ttandroid module to your settings.gradle. Your settings.gradle should already be including your application module.

    include ':app', ':ttandroid'

    Until we publish to an artifact repository, you will need to manually add the dependencies of the ttandroid.aar since AAR's don't (by default) come with their dependencies bundled.

  6. Open your app's build.gradle (YOUR_APP/build.gradle in this case) and add these lines, this includes the instruction for compiling the ttandroid.aar as well as the items for multidexing (as it will be necessary). You will also need some flavor of the support v7 library.

    android {
    ...
    defaultConfig {
    ...
    multiDexEnabled true
    }
    }
    dependencies {
    ...
    implementation fileTree(dir: 'libs', include: ['*.jar'])
    implementation project(':ttandroid')
    implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
    implementation 'com.github.heremaps:oksse:2d7217296d'
    implementation "com.parse.bolts:bolts-tasks:1.4.0"
    implementation 'com.google.firebase:firebase-core:16.0.8'
    implementation "com.google.firebase:firebase-messaging:17.6.0"
    implementation 'net.zetetic:android-database-sqlcipher:4.2.0'
    implementation 'android.arch.persistence:db:1.1.1'
    implementation 'com.squareup.retrofit2:retrofit:2.5.0'
    implementation 'com.jakewharton.timber:timber:4.7.1'
    }

Your project should now be able to compile with everything set up.

MultiDex

Since you will likely be needing to turn have multidex on, the least complex way to get MultiDex going with your application is to add the code below to your Application class.

public class MyApplication extends MultiDexApplication {
...
}

There are other ways to go about MultiDex, all of which can be found here.

Initialize the SDK

  1. Create an Application class in your project.

  2. Instantiate TT.java in Application class's onCreate() method.

    public class MyApplication extends MultiDexApplication {
    @Override
    public void onCreate() {
    super.onCreate();
    TT.init(getApplicationContext(), "your.application.package");
    }
    }

At this point the SDK is initialized and ready to be used. This initialization step has to be executed before taking any actions on the managers.