Home / Android / SDK Integration - Android Studio / Integration as dependency

SDK Integration - AndroidStudio

Integration as dependency

To integrate Tappx in your Android Studio Project you have to modify the build.gradle file (usually located in MyProject/app/build.gradle) and add it to the mavenCentral repository (only if the file is not added yet) and finally add the dependency to the Tappx SDK library.

1. MavenCentral Repository:

repositories {
mavenCentral()
}

2. Tappx SDK and Google Play Services dependencies:

dependencies {
//Otras dependencias
implementation 'com.tappx.sdk.android:tappx-sdk:4.+'
}

Example of build.gradle file integrating the SDK (added lines in yellow). MyProject/app/build.gradle:

apply plugin: 'com.android.application'

android {
compileSdkVersion 25
buildToolsVersion "25.0.2"
defaultConfig {
applicationId "com.tappx.samples"
minSdkVersion 16
targetSdkVersion 23
versionCode 512
versionName "5.12"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}

repositories {
mavenCentral()
}

dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.tappx.sdk.android:tappx-sdk:4.+'
}

3. Activate geolocation (Recommended):

Setting the call to this function to "TRUE" will trigger custom ad search by geolocation. This it can cause revenue to increase by having more focused ads for the user. It must be placed in some main function know that it will be executed.

Tappx.setCollectLocationEnabled(context,true);