Skip to main content

Android Kotlin SDK - One-page setup

Create your app and get the key

  1. Log in to testernest.com and create an app.
  2. Copy the publicKey from your app settings.
  3. Copy the baseUrl from SDK Setup for your environment.

1) Install

In settings.gradle.kts (recommended):

dependencyResolutionManagement {
repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
repositories {
google()
mavenCentral()
}
}

Then in app/build.gradle.kts:

dependencies {
implementation("com.testernest:testernest-android:0.1.3")
}

Minimum supported versions: Android SDK 21+, Kotlin 1.6+.

2) Permissions

In AndroidManifest.xml:

<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />

3) Initialize

Create or reuse your Application class and initialize once on app start:

import android.app.Application
import com.testernest.android.Testernest

class App : Application() {
override fun onCreate() {
super.onCreate()

Testernest.init(
context = this,
publicKey = "YOUR_PUBLIC_KEY",
baseUrl = "https://testernest.com",
enableLogs = BuildConfig.DEBUG
)
}
}

Register it in AndroidManifest.xml:

<application
android:name=".App"
...>
</application>

4) Connect tester (6-digit code)

Recommended: show the auto-connect prompt in onResume() when the user is not connected yet.

override fun onResume() {
super.onResume()
Testernest.attachAutoConnectPrompt(this, config = connectPromptConfig)
}

The prompt appears until a tester is connected, then it stops showing.

Manual fallback:

fun onConnectCodeEntered(code6: String) {
Testernest.connectTester(code6)
}

5) Track screens + events (minimal)

Use one canonical screen name per screen and semantic event names.

override fun onResume() {
super.onResume()
Testernest.setCurrentScreen("Home")
}

fun onScreen1TileTapped() {
Testernest.logEvent(
"navigate",
mapOf(
"from" to "Home",
"to" to "Screen 1",
"element_id" to "tileScreen1"
)
)
}

Naming guidance:

  • Keep one canonical name per screen (for example: Home, Screen 1, Settings).
  • Use semantic event names and stable properties (for example: navigate, tap, element_id).

Call Testernest.flushNow() when you need to force-send buffered events (for example, before app shutdown in debug sessions).

6) Verify

Filter Logcat for the following tags:

  • BOOTSTRAP
  • CLAIM
  • BATCH

Success signals:

  • BOOTSTRAP: key accepted and SDK initialized
  • CLAIM 200: tester code connected
  • BATCH 200: events uploaded successfully

Troubleshooting

  • Invalid code: Generate a fresh 6-digit code and try again.
  • Still failing: Confirm your publicKey belongs to the same app in the dashboard.
  • No logs: Verify initialization runs before the prompt is shown.