Installation

A step-by-step guide on how to install Tap SDK on Android.

👍

Visit our Brankas Collection for Android, to see a sample project of how to integrate the SDK.

📘

Minimum Requirements

  1. Android Studio 3.0 but preferably the latest version
  2. Minimum Android SDK: API 17 or Android 4.2

Installation

This set of instructions assumes that the IDE being used is Android Studio

  1. In your project build.gradle, ensure to add the URL of the repository under maven. Here is a sample:
allprojects {
    repositories {
            maven {
                url = "https://maven.pkg.github.com/brankas/core-sdk-android"
                credentials {
                        username = ""
                        password = ""
                }
            }
    }

📘

You can use any GitHub Account in filling up the credentials

  1. In your app build.gradle file, add this line inside the dependencies configuration: implementation "com.brankas.tap:direct-tap:3.3.0" to set the SDK as a dependency for the application.

📘

Change com.brankas.tap:direct-tap:3.3.0 to the relevant Brankas product you are integrating with

dependencies {
    implementation "com.brankas.tap:direct-tap:3.3.0"
}
  1. Inside the the same dependencies configuration, insert the following lines to enable gRPC Connections which are needed by the SDK. Also, include RxJava for asynchronous listening to the results

❗️

Do not forget to include compileOptions and kotlinOptions to use Java 8

dependencies {
    implementation 'com.google.protobuf:protobuf-javalite:3.19.0-rc-1'
        implementation 'io.grpc:grpc-okhttp:1.41.0'
        implementation('io.grpc:grpc-protobuf-lite:1.41.0') {
                exclude group: 'com.google.protobuf'
        }
        implementation 'io.grpc:grpc-stub:1.41.0'
        implementation 'io.reactivex.rxjava3:rxjava:3.0.0'
        implementation 'io.reactivex.rxjava3:rxandroid:3.0.0'
        //implementation "org.jetbrains.kotlinx:kotlinx-coroutines-rx2:$kotlin_coroutines_version"
            implementation "androidx.security:security-crypto:1.1.0-alpha03"
            implementation 'org.jetbrains.kotlinx:kotlinx-serialization-json:1.3.2'
}

compileOptions {
            sourceCompatibility JavaVersion.VERSION_1_8
            targetCompatibility JavaVersion.VERSION_1_8
}

kotlinOptions {
        jvmTarget = "1.8"
}
```

❗️

To mix coroutines and RxJava in the same project, include the optional dependency commented out

  1. In the plugins section, add these:
plugins { id 'com.android.application' id 'kotlin-android' id 'kotlin-parcelize' id 'org.jetbrains.kotlin.plugin.serialization' version '1.6.10' } ````
  1. Add the permission android.permission.INTERNET in your AndroidManifest.xml file to allow your application to access Internet, which is required to use Tap API Services.
<uses-permission android:name="android.permission.INTERNET" />

Did this page help you?