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
- Android Studio 3.0 but preferably the latest version
- Minimum Android SDK: API 21 or Android 5.0
Installation
This set of instructions assumes that the IDE being used is Android Studio
- 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
- In your app build.gradle file, add this line inside the dependencies configuration: implementation "com.brankas.tap:direct-tap:4.1.0" to set the SDK as a dependency for the application as follow.
dependencies {
implementation "com.brankas.tap:direct-tap:4.1.0"
}
- Inside 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.20.0'
implementation 'io.grpc:grpc-okhttp:1.45.1'
implementation('io.grpc:grpc-protobuf-lite:1.45.1') {
exclude group: 'com.google.protobuf'
}
implementation 'io.grpc:grpc-stub:1.45.1'
implementation 'io.reactivex.rxjava3:rxjava:3.0.6'
implementation 'io.reactivex.rxjava3:rxandroid:3.0.0'
//implementation "org.jetbrains.kotlinx:kotlinx-coroutines-rx2:$kotlin_coroutines_version"
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"
}
How to mix coroutines and RxJava in the same project
You can include the optional dependency commented out.
- 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' } ````
- 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" />
Updated almost 2 years ago