Skip to content

API

The LiteratorClient singleton provides several convenience methods and callbacks. These methods are available after the SDK is initialized. Additional configuration is provided via LiteratorConfig.builder(). Refer to the initialization instructions to get started.

Analytics

In order to forward analytics calls, please reference the below APIs invoked on Literator.

Method Description
sendAnalytics(key: String, bundle: Bundle) Forward analytics using an Android Bundle
sendAnalytics(key: String, map: Map<String, Any>) Forward analytics using a Map<String, Any> (Kotlin) or Map<String, Object> (Java)
sendAnalytics(key: String, jsonProperties: JSONObject) Forward analytics using a JSONObject

Build ID

A unique app board is created according to these criteria:

  • App name
  • App version
  • Operating system

Screens from recordings with the same criteria will appear on the same board. However, you may override the standard behavior by providing a custom build identifier.

Use custom identifier

During regular development cycles, it's common to retain the existing app version until a new app store release is created. This means that new app content may appear on the same board unintentionally.

The standard board behavior can be overridden by providing a custom app identifier. A common example is to use the current date or a commit SHA.

To create a separate board per commit hash, store the value in a BuildConfig field and provide it via customBuildIdentifier.

val literatorConfig = LiteratorConfig.builder()
    .customBuildIdentifier(BuildConfig.CURRENT_GIT_HASH)
    .build()
LiteratorConfig literatorConfig = LiteratorConfig.builder()
    .customBuildIdentifier(BuildConfig.CURRENT_GIT_HASH)
    .build();

Use device model

To create a separate board per unique device model, leverage useDeviceAsBuildIdentifier.

val literatorConfig = LiteratorConfig.builder()
    .useDeviceAsBuildIdentifier()
    .build()
LiteratorConfig literatorConfig = LiteratorConfig.builder()
    .useDeviceAsBuildIdentifier()
    .build();

Network Insights

In order to capture network insights, add our Interceptor to your OkHttpClient.Builder instance. Multiple OkHttp client instances are supported, however, OkHttp must be at least version 3. Request headers may be filtered out client side if needed.

Note: Requests will be intercepted after the Literal SDK has successfully started a session.

val client = OkHttpClient.Builder()
    .addNetworkInterceptor(LiteratorConfig.provideNetworkInterceptor())
    .build()
OkHttpClient client = new OkHttpClient.Builder()
    .addNetworkInterceptor(LiteratorConfig.provideNetworkInterceptor())
    .build();

Recording Options

In order to request recording state changes programmatically, please reference the below APIs invoked on Literator.

Method Description
Literator.startRecordingRequest() Request a new recording session. This will invoke the permission dialog if required.
Literator.resumeRecording() Resume a recording if the current state is paused.
Literator.pauseRecording() Pause a recording if the current state is recording.
Literator.stopRecording() Stop a recording if the current state is recording.