Android installation
Requirements
Section titled “Requirements”minSdk23 (Android 6.0) or higher- The team’s SDK key (
rsk_…) from the form’s Share → Mobile app tab
The SDK is written in Kotlin and can be called from Java. The package is com.responsly.sdk.
Install
Section titled “Install”The artifact is com.responsly:sdk. It is not on Maven Central. Make it available to your build as described in your access details, then add the dependency.
dependencies { implementation("com.responsly:sdk:1.34.0")}dependencies { implementation 'com.responsly:sdk:1.34.0'}[versions]responsly = "1.34.0"
[libraries]responsly-sdk = { module = "com.responsly:sdk", version.ref = "responsly" }dependencies { implementation(libs.responsly.sdk)}Initialize
Section titled “Initialize”Call initialize once in Application.onCreate. Calls made before it (identify, track, screen and the rest) are remembered and applied when the SDK starts.
import android.app.Applicationimport android.content.pm.ApplicationInfoimport com.responsly.sdk.*
class MyApp : Application() { override fun onCreate() { super.onCreate() val debuggable = (applicationInfo.flags and ApplicationInfo.FLAG_DEBUGGABLE) != 0 Responsly.initialize( applicationContext, "rsk_…", ResponslyOptions(logLevel = if (debuggable) LogLevel.DEBUG else LogLevel.ERROR) ) }}Register the class if your app does not have an Application subclass yet:
<application android:name=".MyApp"> <!-- activities --></application>initialize is idempotent for the same key. Calling it with a different key resets the SDK’s local state first.
Options
Section titled “Options”ResponslyOptions has two fields.
| Field | Values | Notes |
|---|---|---|
logLevel | LogLevel.NONE, LogLevel.ERROR, LogLevel.INFO, LogLevel.DEBUG | Use DEBUG while integrating. See Testing & debugging. |
apiHost | String | Defaults to https://api.responsly.com. Leave it unset unless Responsly support gives you another host. |
Permissions
Section titled “Permissions”The only permission the SDK uses is INTERNET. Most apps declare it already. If yours does not, add it:
<uses-permission android:name="android.permission.INTERNET" />The SDK does not read the advertising ID and needs no other permission.
ProGuard and R8
Section titled “ProGuard and R8”Nothing to add. The SDK ships its own consumer rules, and they are applied to your build automatically.
What you do not need to do
Section titled “What you do not need to do”- Pass an activity. The SDK presents surveys above the app’s current activity by itself.
- Handle the back button. System back closes a survey that the respondent is allowed to close.
Check the installation
Section titled “Check the installation”Log.d("MyApp", "Responsly SDK ${Responsly.SDK_VERSION}") // 1.34.0Run the app with LogLevel.DEBUG and filter Logcat by Responsly.