Supported Android versions
Fully supported on Android Lollipop (API 21)
You can integrate Smartlook on Android Jelly Bean (API 18), however, you will not be able to record user sessions.
Integrating the Smartlook SDK
To begin recording user sessions on your mobile apps, integrate the SDK.
- Implement the Smartlook analytics library in the Gradle file of your module:
implementation("com.smartlook.android:smartlook-analytics:<<current-android-2-0-sdk-version>>")
implementation 'com.smartlook.android:smartlook-analytics:<<current-android-2-0-sdk-version>>'
- Declare the repository in the project-level Gradle settings file:
dependencyResolutionManagement {
repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
repositories {
maven("https://sdk.smartlook.com/android/release")
}
}
dependencyResolutionManagement {
repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
repositories {
maven {
url "https://sdk.smartlook.com/android/release"
}
}
}
Gradle 6.8+
For older versions of Gradle, you need to declare the Smartlook Maven repository in the project-level Gradle file:
allprojects { repositories { maven { url = uri("https://sdk.smartlook.com/android/release") } } }
allprojects { repositories { maven { url "https://sdk.smartlook.com/android/release" } } }
- Enter your unique
projectKey
and thestart()
call for Smartlook to record user sessions. If you do not know your project key, you can find it in the mobile project settings on the Smartlook Dashboard.
To start recording when the user opens the app, use the Application
class and onCreate()
:
class MyCustomApplication : Application() {
override fun onCreate() {
super.onCreate()
val smartlook = Smartlook.instance
smartlook.preferences.projectKey = "YOUR PROJECT KEY"
smartlook.start()
}
}
public class MyCustomApplication extends Application {
@Override
public void onCreate() {
super.onCreate();
Smartlook smartlook = Smartlook.getInstance();
smartlook.getPreferences().setProjectKey("YOUR PROJECT KEY");
smartlook.start();
}
}
region
propertyThe
region
property identifies the location of the data center where metadata for your organization is stored. However, this does not ensure that all user data is stored in this region. When implementing the SDK, be sure to input theREGION
parameter value as shown in the Smartlook project settings. For more information on where to find your region, see Organization settings.Smartlook can store metadata in the EU and North America. If you want to change your data storage location, contact Smartlook Sales or Support.
Smartlook now records all user sessions on your app. All new user sessions will appear in the Smartlook player.
Recording when on a mobile network
The Smartlook SDK only uploads sessions when the device is connected to wifi. If you would like to upload your data when the device is on mobile data, you can enable Upload on mobile (cellular) data in project settings. For more information, see When will session recordings appear on my dashboard?.
SDK update & migrations
The Migration guide describes the migration from version 1.x.x to version 2.x.x.