First Steps
Android Classic - First Steps
You are viewing the V4 docs. This is the preferred version for Android and iOS.
To select an earlier version, use the nav bar (above):
Tips
- Classic integration is the preferred method of integration.
- While reading the documentation, take a look at our Sample App.
The following steps are common to both Classic and Web integrations.
The Repository URL
There are 2 options, depending on how you configure your project repositories.
All versions of the Taboola SDK are available via Artifactory.
Option I: build.gradle
If you are using build.gradle
or build.gradle.kts
to configure your repositories, add the Taboola URL in your top-level build.gradle
or build.gradle.kts
file, under allprojects
> repositories
:
buildscript {
repositories {
...
}
dependencies {
...
}
}
allprojects {
repositories {
...
maven {
// Taboola:
url 'https://taboolapublic.jfrog.io/artifactory/mobile-release'
}
}
}
buildscript {
repositories {
...
}
dependencies {
...
}
}
allprojects {
repositories {
...
maven {
// Taboola:
url = uri("https://taboolapublic.jfrog.io/artifactory/mobile-release")
}
}
}
Add the Taboola URL:
- In your top-level
build.gradle
orbuild.gradle.kts
file.- Under
allprojects
>repositories
.
Option II: settings.gradle
If you are using settings.gradle
or settings.gradle.kts
to configure your repositories, add the Taboola URL in settings.gradle
or settings.gradle.kts
):
dependencyResolutionManagement {
repositoriesMode.set(RepositoriesMode.PREFER_SETTINGS)
repositories {
google()
mavenCentral()
jcenter()
maven {
// Taboola:
url "https://taboolapublic.jfrog.io/artifactory/mobile-release"
}
}
}
dependencyResolutionManagement {
repositoriesMode.set(RepositoriesMode.PREFER_SETTINGS)
repositories {
google()
mavenCentral()
jcenter()
maven {
// Taboola:
url = uri("https://taboolapublic.jfrog.io/artifactory/mobile-release")
}
}
}
Dependencies
In your app module build.gradle
or build.gradle.kts
file, add the Taboola and AndroidX Browser dependencies:
dependencies {
// Always required:
implementation 'com.taboola:<<androidSDKName>>:<<androidSDK4Version>>'
// To open the clicked item in a new *tab*:
implementation '<<androidXBrowser>>'
// For projects based on Java 1.7, use this version *instead*:
// implementation 'androidx.browser:browser:1.0.0'
}
dependencies {
// Always required:
implementation("com.taboola:<<androidSDKName>>:<<androidSDK4Version>>")
// To open the clicked item in a new *tab*:
implementation("<<androidXBrowser>>")
// For projects based on Java 1.7, use this version *instead*:
// implementation("androidx.browser:browser:1.0.0")
}
SDK versionWe recommend using the latest Taboola SDK version -
{user.androidSDK4Version}
.Taboola SDK has been tested with
{user.testedV4WithAndroidVersion}
.
AndroidXAs of release 3.3.0, Taboola SDK requires AndroidX.
For information about migrating your project to AndroidX, see this article.
AndroidX BrowserYou can optionally install AndroidX Browser:
If present, Taboola SDK will use it to open the clicked item in a new tab. If not present, Taboola SDK will use the system browser to open the clicked item in an external window.
Permissions
In AndroidManifest.xml
:
- Make sure that the following permissions are present:
<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
<!-- (Recommended) Allows Taboola SDK to use the 'IAB OM SDK': -->
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE"/>
IAB OM SDKTaboola SDK uses the IAB OM SDK to utilize third-party viewability providers and unlock premium demand.
- If your App targets Android 12 (API 31) or higher, add the following permission to access the Advertising Identifier:
<uses-permission android:name="com.google.android.gms.permission.AD_ID"/>
AD_ID permissionAdding the AD_ID permission helps optimize business performance.
For more information about using the Advertising Identifier, see here.
Note: Taboola adheres to all privacy rules.
Need a hand?Go ahead! Ask a question in our Support Forum.
Tip: Provide as much detail as possible, including your platform and SDK version.
Next steps
Updated 2 days ago