Android
Step by step guide to help you with Leap Android SDK Integration

This guide will help you set up the Leap platform for Android devices. You can follow the steps below to integrate Leap SDK before using your dashboard to create in-app experiences.

Prerequisites

  • You will need the API key.
  • The minimum API version support for Leap SDK is API 16. But Leap works only for API levels greater or equal to 21.
  • An Android 5.0 or newer device or emulator with Google Play services installed.
  • Your project should be using AndroidX

SDK Installation

Note: Ensure that you complete both the steps in order to create and test the in-app experience in your integrated build.

Step 1. Integrate Leap SDK

1.a. Add Dependencies
Add the Leap library's dependency to your module (app-level) Gradle file (usually app/build.gradle) as follows:
Leap SDK is hosted at mavenCentral. Make sure to add mavenCentral in your repositories.
repositories {
mavenCentral()
}
dependencies {
//Leap SDK
implementation 'is.leap.android:sdk:1.5.6'
}
For release notes check here
1.b. Start Leap SDK
You are required to start Leap SDK in yourApplicationclass insideonCreate()function. (If you need help in creating Application class, check here)
Leap.start("<YOUR_API_KEY>");

Step 2. Enable 'Creator mode' in your app

To create in-app experiences in the Leap Studio, you will need to enable the Creator mode in your app. This can be done by integrating the Leap Creator SDK.
2.a Add Dependencies
Add the Leap Creator library's dependency to your module (app-level) Gradle file (usually app/build.gradle) as following:
The Leap Creator SDK must be removed before you make the build live on Google Playstore.
repositories {
mavenCentral()
}
dependencies {
//Leap Developer SDK
implementation 'is.leap.android:creator-sdk:1.5.6'
}
2.b Start Leap Creator SDK
Start Leap Creator SDK in your Application class insideonCreate()function. (If you need help in creating Application class, check here)
LeapCreator.start("<YOUR_API_KEY>");
Proguard rules: If you are using Proguard for your builds, add the following rules in yourproguard-rules.pro file
-dontwarn is.leap.android.**
-keep class is.leap.android.** {*;}
WebView Support: If you want Leap to run in the Activity/Fragment which contains WebView then check here for WebView support.
Chrome tabs Support: Chrome tabs are not supported as it doesn't support javascript injection.
Help with Audio Ducking: Leap supports audio ducking but if you haveExoPlayer , and you expect Leap to duck audio on that window then refer here. (Ignore this if you have already handled audio focus)
Setup Leap Callbacks: Click here.
Setup Segmentation Support: Click here.
Creating Application Class: Check here if you need help in creating theApplicationclass. (Ignore this if you already have one)
Copy link
On this page
Prerequisites
SDK Installation