Android
Step by step guide to help you with Leap Android SDK Integration
- 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
- See Google's AndroidX migration guide to update from the Android Support Library if you are still using this.
Note: Ensure that you complete both the steps in order to create and test the in-app experience in your integrated build.
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.6.1'
}
1.b. Start Leap SDK
You are required to start Leap SDK in your
Application
class insideonCreate()
function. (If you need help in creating Application
class, check here)Leap.start("<YOUR_API_KEY>");
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.6.1'
}
2.b Start Leap Creator SDK
Start Leap Creator SDK in your Application class inside
onCreate()
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 your
proguard-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 have
ExoPlayer
, and you expect Leap to duck audio on that window then refer here. (Ignore this if you have already handled audio focus)Creating Application Class: Check here if you need help in creating the
Application
class. (Ignore this if you already have one)Last modified 1mo ago